i try to replace some arabic caractere with another symbole some arbic caractere is replaced but one of this caractere it not replaced first i try to split the word second try to replace the caractere the caractere is َ ً ٍ ِ ْ ُ all this are replaced but the problem is with this caractere ّ strong text this is the code
$spelling="";
function str_split_unicode($str, $l = 0) {
if ($l > 0) {
$ret = array();
$len = mb_strlen($str, "UTF-8");
for ($i = 0; $i < $len; $i += $l) {
$ret[] = mb_substr($str, $i, $l, "UTF-8");
}
return $ret;
}
return preg_split("//u", $str, -1, PREG_SPLIT_NO_EMPTY);
}
if(isset($_POST['txt_word'])){
$spelling = implode(" ", str_split_unicode($_POST['txt_word']));
}
$search = array('ّّ ','ً ','ٍ ','ٌ ','ُ ','َ ','ِ ','ْ ');
$replace = array('0/','/0','/0','/0','/','/','/','0');
$subject= str_replace($search, $replace, $spelling);
$alphabet=array('أ','ا','ب','ت','ث','ج','ح','خ','د','ذ','ر','ز','س','ش','س','ص','ط','ظ','ع','غ','ف','ق','ل','م','ن','ه','و','ي','لا','ة','إ','ئ','ؤ','ك','ى','ء');
$rep=array('','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','');
$res=str_replace($alphabet,$rep,$subject);