note 28696 modified in function.wordwrap by aidan
| From: | aidan@php.net | Date: | Mon, 19 Jul 2004 23:27:18 +0000 |
| Subject: | note 28696 modified in function.wordwrap by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-73657@lists.php.net to get a copy of this message | ||
I use preg_replace instead...
This function doesn't cut in HTML tags, just in the plain text.
<?php
function WrapWords($str, $chars) {
$str = preg_replace('/([^\s\<\>]{'.$chars.','.$chars.'})/',
'\1 ', $str);
return $str;
}
?>
--was--
I use preg_replace instead...
This function doesn't cut in HTML tags, just in the plain text.
function WrapWords($str, $chars) {
$str = preg_replace('/([^\s\<\>]{'.$chars.','.$chars.'})/',
'\1 ', $str);
return $str;
}
http://php.net/manual/en/function.wordwrap.php