note 88458 deleted from function.str-replace by danbrown
| From: | danbrown@php.net | Date: | Sun, 25 Jan 2009 17:02:04 +0000 |
| Subject: | note 88458 deleted from function.str-replace by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-149759@lists.php.net to get a copy of this message | ||
Note Submitter: http://sokolov.cc
----
At Daniel Vidal:
Your function is obsolete by standart PHP strtr function, which is way faster.
On it's page you will find this:
<?php
function normaliza ($string){
$a =
'ÃÃÃÃÃÃ
ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃ
Ãà áâãäåæçèéêëìÃîïðñòóôõöøùúûýýþÿÅÅ';
$b = 'aaaaaaaceeeeiiiidnoooooouuuuy
bsaaaaaaaceeeeiiiidnoooooouuuyybyRr';
$string = utf8_decode($string);
$string = strtr($string, utf8_decode($a), $b);
$string = strtolower($string);
return utf8_encode($string);
}
?>
This code solves your problem in a much more elegant way.