Reputation: 33
I have a text such " مُشْكِلَةٌ " in db. How can I get " مشكلة " from this text in php( str_replace etc ). I have tried str_replace it didn't work
Upvotes: 1
Views: 1145
Reputation: 1443
Code
$string = 'مُشْكِلَةٌ';
$diacritic = array('ِ', 'ُ', 'ٓ', 'ٰ', 'ْ', 'ٌ', 'ٍ', 'ً', 'ّ', 'َ');
$newString = str_replace($diacritic, '', $string);
echo "Old String : ".$string;
echo "New String : ".$newString;
Output
Old String : مُشْكِلَةٌ
New String : مشكلة
Upvotes: 2