note 45713 added to function.wordwrap
| From: | thr at recide dot net | Date: | Wed, 15 Sep 2004 21:09:21 +0000 |
| Subject: | note 45713 added to function.wordwrap | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-76801@lists.php.net to get a copy of this message | ||
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;
}
----
Manual Page -- http://www.php.net/manual/en/function.wordwrap.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+45713
Delete -- http://master.php.net/manage/user-notes.php?action=delete+45713&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+45713&report=yes
Search -- http://master.php.net/manage/user-notes.php