string wordwrap ( string str [, int line_length[, string break_char [, bool cut]]] )
$text = "this is a test. this is a test. this is a test. this is a test. this is a test. this is a test. this is a test.";
$text = wordwrap($text, 20, "<br />");
print $text;
Related examples in the same category