note 41364 deleted from function.str-replace by nlopess
| From: | nlopess@php.net | Date: | Fri, 09 Apr 2004 14:18:53 +0000 |
| Subject: | note 41364 deleted from function.str-replace by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-67884@lists.php.net to get a copy of this message | ||
Note Submitter: leif@harmsen.net
----
Here's a better accent killer, great for non accent sensitive searches. I've just added
more accented characters.
function strToNoaccents($text) {
global $export;
$search = array ('À', 'Á', 'Â' ,'Ã' ,'Ç'
,'È' ,'É' ,'Í' ,'Ò' ,'Ó' ,'Ô'
,'Õ' ,'Ú', 'ç', 'à', 'á', 'â',
'ã', 'è', 'é', 'ê', 'í', 'î',
'ò', 'ó', 'ô', 'õ', 'ú', 'û');
$replace = array ('A', 'A', 'A', 'A', 'C',
'E', 'E', 'I', 'O', 'O', 'O',
'O', 'U', 'c', 'a', 'a', 'a',
'a', 'e', 'e', 'e', 'i', 'i',
'o', 'o', 'o', 'o', 'u', 'u');
$export = str_replace($search, $replace, $text);
return $export;
}