note 10271 added to wordwrap
| From: | gray_cardinal at hotmail dot com | Date: | Fri, 22 Dec 2000 10:52:02 +0000 |
| Subject: | note 10271 added to wordwrap | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-9022@lists.php.net to get a copy of this message | ||
It's a little tricky, but short and fine...
$txt = "shut da f%$@ up, you ugly little creature!";
if (strlen($txt)>20)
$txt = wordwrap($txt, 20, "\0")."...";
echo $txt;
http://www.php.net/manual/function.wordwrap.php