note 91240 deleted from function.str-split by danbrown

From: Date: Mon, 01 Jun 2009 12:53:45 +0000
Subject: note 91240 deleted from function.str-split by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-156218@lists.php.net to get a copy of this message
Note Submitter: omnibus at omnibus dot edu dot pl ---- 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.

« previous php.notes (#156218) next »