Mega Code Archive

 
Categories / Php / Strings
 

Wordwrap() doesnt break at your line limit if a word has more characters than the limit

<?php $string = "this is a test. this is a test.this is a test.this is a test.this is a test."; $string .= "this is a test.this is a test.this is a test.this is a test.this is a test.!"; print wordwrap( $string, 24, "<br/>\n", 1 ); ?>