What is the recommended function in PHP to split a string into multiple lines without breaking words?

When splitting a string into multiple lines in PHP, we can use the `wordwrap()` function. This function breaks the string into multiple lines without breaking words by specifying the desired line length as the second parameter. It ensures that words are not split across lines and maintains the readability of the text.

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

echo $wrapped_string;