My previous related question:
php work with images : write complete word in arabic , ttf font
My problem was:
- If I want to write
????
in image it appears as ? ? ? ?
- Well, I fixed it and now the output:
? ? ? ?
Using this function:
function arab($word){
$w = explode(' ',$word) ;
$f = array(array('?','?'),'?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?');
$t = array(array('?_','?_'),'?_','?_','?_','?_','?_','?_','?_','?_','?_','?_','?_','?_','?_','?_','?_','?_','?_','?_','?_','?_','?_','?_','?_','?_','?_','?_');
$my_arab = '' ;
foreach($w as $wo)
{
$r = array() ;
$wo = str_replace($f , $t ,$wo);
$ne = explode('_', $wo) ;
foreach($ne as $new) {
$new = str_replace('_','',$new) ;
array_unshift($r , $new);
}
$my_arab .= ' '.implode('',$r) ;
}
return trim($my_arab) ;
}
But the new problem is:
? ? ? ?
(separated letters) where it should be:
????
How can I fix this?
See Question&Answers more detail:
os