Created
December 1, 2017 14:05
-
-
Save renorram/80bbcebe9fa23436b7be6a81d2a200c7 to your computer and use it in GitHub Desktop.
Replace accented characters
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
<?php | |
/** | |
* Replace accented characters | |
* @param $string | |
* | |
* @return string | |
*/ | |
public function stripAccents($string) | |
{ | |
return preg_replace('/[`^~\'"]/', null, iconv('UTF-8', 'ASCII//TRANSLIT', $string)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment