What advantages does the PHP function wordwrap offer compared to manually adjusting table width for long words?

When displaying text in a table, long words can cause the table to expand beyond its intended width, making the layout look messy. Manually adjusting the table width for long words can be time-consuming and may not always result in a clean layout. Using the PHP function wordwrap can automatically wrap long words to the next line, ensuring that the table stays within its designated width and maintaining a neat appearance.

<?php
$text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ultricies odio at nunc varius, vel ultricies elit aliquam.";
$wrapped_text = wordwrap($text, 20, "<br>");
echo "<table border='1'><tr><td>" . $wrapped_text . "</td></tr></table>";
?>