note 99316 added to function.chunk-split
| From: | belal dot nabeh at gmail dot com | Date: | Tue, 10 Aug 2010 15:02:45 +0000 |
| Subject: | note 99316 added to function.chunk-split | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-171522@lists.php.net to get a copy of this message | ||
If you are using UTF-8 charset you will face a problem with Arabic language
to solve this problem i used this function
function chunk_split_($text,$length,$string_end)
{
$text = iconv("UTF-8","windows-1256",$text);
$text = str_split($text);
foreach($text as $val)
{
if($a !== $val)
{
$a = $val;
$x = 0;
}else{
$a = $val;
$x++;
}
if($x > $length)
{
$new_text .= $val.$string_end;
$x = 0;
}else
{
$new_text .= $val;
}
}
$new_text = iconv("windows-1256","UTF-8",$new_text);
return $new_text;
}
----
Server IP: 69.147.83.197
Probable Submitter: 217.165.156.123 (proxied: 217.165.156.123)
----
Manual Page -- http://www.php.net/manual/en/function.chunk-split.php
Edit -- https://master.php.net/note/edit/99316
Del: integrated -- https://master.php.net/note/delete/99316/integrated
Del: useless -- https://master.php.net/note/delete/99316/useless
Del: bad code -- https://master.php.net/note/delete/99316/bad+code
Del: spam -- https://master.php.net/note/delete/99316/spam
Del: non-english -- https://master.php.net/note/delete/99316/non-english
Del: in docs -- https://master.php.net/note/delete/99316/in+docs
Del: other reasons-- https://master.php.net/note/delete/99316
Reject -- https://master.php.net/note/reject/99316
Search -- https://master.php.net/manage/user-notes.php