Wordwrap() doesnt break at your line limit if a word has more characters than the limit
$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, " \n", 1 ); ?>