In one layer, because everyone loves single-line :)
$s = "biger text1 123 text biger 678 biger text"; $max_line_length = 10; echo join("\n", array_map(function($item) { return '<li>' . $item . '</li>'; }, explode("\0", wordwrap($s, $max_line_length, "\0"))));
Return:
<li>biger</li> <li>text1 123</li> <li>text biger</li> <li>678 biger</li> <li>text</li>
Ja͢ck source share