note 91240 added to function.str-split
| From: | omnibus at omnibus dot edu dot pl | Date: | Mon, 01 Jun 2009 10:07:18 +0000 |
| Subject: | note 91240 added to function.str-split | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-156213@lists.php.net to get a copy of this message | ||
In reply to what mattias at lsahlin dot se wrote I confirm it. The simple solution, if you know that
the particular string can be fully written in some iso (and you know which one it is), you may do
the following:
$tmpStr = iconv("utf-8", "iso-8859-2", $str); // change iso-8859-2 into yours
$tmpSubStrings = str_split($tmpStr, $length);
foreach ($tmpSubStrings as $tmpSS)
$subStrings[] = iconv("iso-8859-2", "utf-8", $tmpSS);
Much to my surprise, this does not take long time. Hope this helps.
----
Server IP: 194.24.174.37
Probable Submitter: 81.210.20.253
----
Manual Page -- http://www.php.net/manual/en/function.str-split.php
Edit -- https://master.php.net/note/edit/91240
Del: integrated -- https://master.php.net/note/delete/91240/integrated
Del: useless -- https://master.php.net/note/delete/91240/useless
Del: bad code -- https://master.php.net/note/delete/91240/bad+code
Del: spam -- https://master.php.net/note/delete/91240/spam
Del: non-english -- https://master.php.net/note/delete/91240/non-english
Del: in docs -- https://master.php.net/note/delete/91240/in+docs
Del: other reasons-- https://master.php.net/note/delete/91240
Reject -- https://master.php.net/note/reject/91240
Search -- https://master.php.net/manage/user-notes.php