What are the limitations of using PHP to control text width in comparison to HTML and CSS?

When using PHP to control text width, one limitation is that PHP is primarily a server-side language and doesn't have the same level of control over styling as HTML and CSS. To overcome this limitation, you can use PHP to generate HTML elements with inline styles or classes that can then be styled using CSS.

<?php
$text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.";

echo "<div style='max-width: 500px;'>$text</div>";
?>