Created
April 12, 2017 07:49
-
-
Save escuccim/3d146df1089defe22f82cc8cfd24a9ef to your computer and use it in GitHub Desktop.
PHP Function to Remove Accents from Strings
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_COMPAT, 'UTF-8')); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment