Created
August 23, 2012 08:58
-
-
Save mattclements/3434413 to your computer and use it in GitHub Desktop.
Encoding New
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Unaccent($string) | |
{ | |
return preg_replace('~&([a-z]{1,2})(?:acute|cedil|circ|grave|lig|orn|ring|slash|th|tilde|uml|caron);~i', '$1', htmlentities($string, ENT_QUOTES, 'UTF-8')); | |
} | |
echo Unaccent('ľľščťžýáíŕďňä'); // llsctzyairdna | |
echo Unaccent('Iñtërnâtiônàlizætiøn'); // Internationalizaetion |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment