Jump to content

Removing diacritic characters


senyo

Recommended Posts

I found this script that replaces diacritics, but if I use a string instead of text it replaces most of the characters but two of them still show.

$title = "ţ,ă,â,ş,î,Ţ,Ă,Â,Ş,Î";
$search = explode(",","ţ,ă,â,ş,î,Ţ,Ă,Â,Ş,Î");
$replace =explode(",","t,a,a,s,i,T,A,A,S,I");
$urlTitle = str_replace($search, $replace, $title);

 

If $title = $str; â and î don't get replaced, but if $title = "ţ,ă,â,ş,î,Ţ,Ă,Â,Ş,Î"; they get replaced

Link to comment
https://forums.phpfreaks.com/topic/179528-removing-diacritic-characters/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.