This file contains hidden or 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
/** | |
* Returns an string clean of UTF8 characters. It will convert them to a similar ASCII character | |
* www.unexpectedit.com | |
*/ | |
function cleanString($text) { | |
// 1) convert á ô => a o | |
$text = preg_replace("/[áàâãªä]/u","a",$text); | |
$text = preg_replace("/[ÁÀÂÃÄ]/u","A",$text); | |
$text = preg_replace("/[ÍÌÎÏ]/u","I",$text); | |
$text = preg_replace("/[íìîï]/u","i",$text); |