note 88458 added to function.str-replace

From: Date: Sun, 25 Jan 2009 11:16:37 +0000
Subject: note 88458 added to function.str-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-149749@lists.php.net to get a copy of this message
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. ---- Server IP: 82.135.230.5 Probable Submitter: 78.62.19.122 ---- Manual Page -- http://www.php.net/manual/en/function.str-replace.php Edit -- https://master.php.net/note/edit/88458 Del: integrated -- https://master.php.net/note/delete/88458/integrated Del: useless -- https://master.php.net/note/delete/88458/useless Del: bad code -- https://master.php.net/note/delete/88458/bad+code Del: spam -- https://master.php.net/note/delete/88458/spam Del: non-english -- https://master.php.net/note/delete/88458/non-english Del: in docs -- https://master.php.net/note/delete/88458/in+docs Del: other reasons-- https://master.php.net/note/delete/88458 Reject -- https://master.php.net/note/reject/88458 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#149749) next »