note 81654 deleted from function.substr by tularis
| From: | tularis@php.net | Date: | Sat, 08 Mar 2008 18:15:15 +0000 |
| Subject: | note 81654 deleted from function.substr by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-136842@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
I tried to use the neat script ben contributed, but for Chinese characters. The characters all
finish with a ";" and start with a "&". eg.: 们
So I altered the script to:
function cutText($string, $length) {
while ($string{$length} != ";") {
$length--;
}
return substr($string, 0, $length);
}
But doesn't work properly (tried ; and &), the function still cuts after the original
$length. Any Ideas?