wordwrap() has two more optional arguments: a number representing the maximum number of characters per line and a string representing the end of the line string. : wordwrap « String « PHP






wordwrap() has two more optional arguments: a number representing the maximum number of characters per line and a string representing the end of the line string.

 
<?php
print wordwrap( $string, 24, "<br/>\n");
?>
  
  








Related examples in the same category

1.wordwrap() doesn't break at your line limit if a word has more characters than the limit.
2.wordwrap() requires one argument, the string to be transformed.
3.string wordwrap ( string str [, int line_length[, string break_char [, bool cut]]] )
4.string wordwrap ( string str [, int width [, string break [, bool cut]]] )
5.Wrapping Text
6.Supply 1 as a fourth parameter, which enables "cut" modewords over the limit will be cut up if this is enabled.