Wrap a string into new lines when it reaches a specific length in PHP
Description
The following code shows how to wrap a string into new lines when it reaches a specific length.
Example
// w w w . java 2s . c o m
<?php
$str = "An example of a long word is: loooooooooooooooooooooooooong";
echo wordwrap($str,15,"<br>\n");
?>
The code above generates the following result.