note 65234 deleted from function.wordwrap by danbrown
| From: | danbrown@php.net | Date: | Sun, 17 May 2009 18:31:56 +0000 |
| Subject: | note 65234 deleted from function.wordwrap by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-155131@lists.php.net to get a copy of this message | ||
Note Submitter: info [ät] travelguides24.com
----
this one is nice, because it does not put any linebreaks or empty spaces if there is enough space.
It is not propper html as seen by validator.w3.org, but it works on IE and Moz.
function splitLongWords($text, $max) {
return preg_replace( '/([^\s]{'.$max.'})(?=[^\s])/',
'$1<wbr>', $text);
}