note 45713 deleted from function.wordwrap by danbrown
| From: | danbrown@php.net | Date: | Sun, 17 May 2009 18:37:15 +0000 |
| Subject: | note 45713 deleted from function.wordwrap by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-155148@lists.php.net to get a copy of this message | ||
Note Submitter: thr at recide dot net
----
An updated function to wrap normal words - and not chars, this will be much faster then the other
ones posted previously:
function real_wordwrap($string,$width,$break)
{
$string = preg_replace('/([^\s]{'.$width.'})/i',"$1$break",$string);
return $string;
}