Re: Problem with non us caracters and "strtr"

From: Date: Fri, 02 Nov 2001 00:17:47 +0000
Subject: Re: Problem with non us caracters and "strtr"
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-73206@lists.php.net to get a copy of this message
Rodrigo Peres wrote:
Hi list, I'm in a big trouble. I'm brazilian, so I've made a script to clean up the special caracters from our language in order to not mess up my publisher, but this script don't work in Macintosh (macos 9.1, IE 5, all in american english). This is my code <? function myclean(&$name) {
    $name = strtolower(strtr($name,
"áéíóúàèìòùäëïöüâêîôûãçÁÉÍÓÚÀÈÌÒÙÄËÏÖÜÂÊÎÔÛÃÇ ", "aeiouaeiouaeiouaeiouacAEIOUAEIOUAEIOUAEIOUAC"));
        return $name;
    }
$temp = myclean($name_actor); echo($temp); ?> What happens is if i try for example to clean up "São Paulo" it prints "são paulo". Why?? The "$name" will receive a string form a text field in a form. my html charset is iso-8859-1
I think you are better to use recode extension for this. Check out recode manual page. -- Yasuo Ohgaki

« previous php.general (#73206) next »