CakeFest 2025 Madrid: The Official CakePHP Conference

Voting

: seven plus zero?
(Example: nine)

The Note You're Voting On

belal dot nabeh at gmail dot com
14 years ago
If you are using UTF-8 charset you will face a problem with Arabic language
to solve this problem i used this function

<?php
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;
}
?>

<< Back to user notes page

To Top