What function in PHP can be used to wrap text after a certain number of characters to prevent layout distortion?

When displaying text on a webpage, it's important to prevent layout distortion by wrapping the text after a certain number of characters. This can be achieved using the `wordwrap()` function in PHP, which breaks a string into lines of a specified length. By using `wordwrap()`, you can ensure that long strings of text do not disrupt the layout of your webpage.

$text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.";
$wrapped_text = wordwrap($text, 30, "<br>");

echo $wrapped_text;