Return to Snippet

Revision: 34558
at October 25, 2010 08:48 by Roen


Updated Code
function filter_accented_characters($stringWithAccentedCharacters) {
$search = explode(",","ç,æ,œ,á,é,í,ó,ú,à,è,ì,ò,ù,ä,ë,ï,ö,ü,ÿ,â,ê,î,ô,û,å,e,i,ø,u");
$replace = explode(",","c,ae,oe,a,e,i,o,u,a,e,i,o,u,a,e,i,o,u,y,a,e,i,o,u,a,e,i,o,u");
$stringWithReplacedCharacters = $urlTitle = str_replace($search, $replace, $stringWithAccentedCharacters);
return $stringWithReplacedCharacters;

}

Revision: 34557
at October 25, 2010 08:45 by Roen


Updated Code
function filter_accented_characters($stringWithAccentedCharacters) {
$search = explode(",","ç,æ,�,á,é,í,ó,ú,à,è,ì,ò,ù,ä,ë,ï,ö,ü,ÿ,â,ê,î,ô,û,å,e,i,ø,u");
$replace = explode(",","c,ae,oe,a,e,i,o,u,a,e,i,o,u,a,e,i,o,u,y,a,e,i,o,u,a,e,i,o,u");
$urlTitle = str_replace($search, $replace, $title);
}

Revision: 34556
at October 25, 2010 07:22 by Roen


Initial Code
function filter_accented_characters($stringWithAccentedCharacters) {
$search = explode(",","ç,æ,œ,á,é,í,ó,ú,à,è,ì,ò,ù,ä,ë,ï,ö,ü,ÿ,â,ê,î,ô,û,å,e,i,ø,u");
$replace = explode(",","c,ae,oe,a,e,i,o,u,a,e,i,o,u,a,e,i,o,u,y,a,e,i,o,u,a,e,i,o,u");
$urlTitle = str_replace($search, $replace, $title);
}

Initial URL
replace-accented-characters

Initial Description

                                

Initial Title
Filter replace accented characters with accent-less equivalent

Initial Tags
php, filter

Initial Language
PHP