note 85556 modified in function.strtr by felipe

From: Date: Mon, 08 Sep 2008 11:12:11 +0000
Subject: note 85556 modified in function.strtr by felipe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-144235@lists.php.net to get a copy of this message
This work fine to me: <?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); } ?> --was-- This work fine to me: 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); } http://php.net/manual/en/function.strtr.php

« previous php.notes (#144235) next »