note 42443 rejected from function.wordwrap by aidan
| From: | aidan@php.net | Date: | Sun, 04 Jul 2004 12:45:31 +0000 |
| Subject: | note 42443 rejected from function.wordwrap by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-72519@lists.php.net to get a copy of this message | ||
Note Submitter:
----
function my_wordwrap ($variable, $size) {
if (strlen($variable) > $size) {
$break = '*:mhhmws:*';
$variable = chunk_split($variable, $size, $break);
$array = explode($break, $variable);
foreach ($array as $key => $value) {
if ($value != '') {
$result .= $value.'<span style="visibility: hidden;width: 0px;height:
0px;"></span>';
}
}
} else {
$result = $variable;
}
return $result;
}