note 80046 added to function.mb-split
| From: | adjwilli at yahoo dot com | Date: | Wed, 26 Dec 2007 17:37:58 +0000 |
| Subject: | note 80046 added to function.mb-split | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-134022@lists.php.net to get a copy of this message | ||
I figure most people will want a simple way to break-up a multibyte string into its individual
characters. Here's a function I'm using to do that. Change UTF-8 to your chosen encoding
method.
function mbStringToArray ($string) {
$strlen = mb_strlen($string);
while ($strlen) {
$array[] = mb_substr($string,0,1,"UTF-8");
$string = mb_substr($string,1,$strlen,"UTF-8");
$strlen = mb_strlen($string);
}
return $array;
}
----
Server IP: 69.147.83.197
Probable Submitter: 68.57.240.195
----
Manual Page -- http://www.php.net/manual/en/function.mb-split.php
Edit -- https://master.php.net/note/edit/80046
Del: integrated -- https://master.php.net/note/delete/80046/integrated
Del: useless -- https://master.php.net/note/delete/80046/useless
Del: bad code -- https://master.php.net/note/delete/80046/bad+code
Del: spam -- https://master.php.net/note/delete/80046/spam
Del: non-english -- https://master.php.net/note/delete/80046/non-english
Del: in docs -- https://master.php.net/note/delete/80046/in+docs
Del: other reasons-- https://master.php.net/note/delete/80046
Reject -- https://master.php.net/note/reject/80046
Search -- https://master.php.net/manage/user-notes.php