note 63657 added to function.strtr
| From: | ladislas_smia at yahoo dot fr | Date: | Mon, 27 Mar 2006 17:37:02 +0000 |
| Subject: | note 63657 added to function.strtr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-106771@lists.php.net to get a copy of this message | ||
A usefull function to create for example, file name according to a formulary submit
<? function CleanText($Text) {
$myString = strtr($Text,"ÃÃÃÃÃÃ
à áâãäå" ,
"AAAAAAaaaaaa");
$myString = strtr($Text,"ÃÃÃÃÃÃòóôõöø" ,
"OOOOOOoooooo");
$myString = strtr($myString,"ÃÃÃÃéèêëÃç",
"EEEEeeeeCc");
$myString =
strtr($myString,"ÃÃÃÃìÃîïÃÃÃÃùúûüÿÃñ
()", "IIIIiiiiUUUUuuuuyNn_--");
$i=0;
$myString2="";
while($i<strlen($myString)){
$letter=substr($myString,$i,1);
if(@ereg("[a-zA-Z0-9_-]",$letter)){
@$myString2.=$letter;
}
$i++;
}
return $myString2;
} ?>
----
Server IP: 66.163.161.117
Probable Submitter: 201.230.140.171
----
X-Spam-Status: Yes, hits=7.4 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER,
HEAD_ILLEGAL_CHARS autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.strtr.php
Edit -- http://master.php.net/note/edit/63657
Del: integrated -- http://master.php.net/note/delete/63657/integrated
Del: useless -- http://master.php.net/note/delete/63657/useless
Del: bad code -- http://master.php.net/note/delete/63657/bad+code
Del: spam -- http://master.php.net/note/delete/63657/spam
Del: non-english -- http://master.php.net/note/delete/63657/non-english
Del: in docs -- http://master.php.net/note/delete/63657/in+docs
Del: other reasons-- http://master.php.net/note/delete/63657
Reject -- http://master.php.net/note/reject/63657
Search -- http://master.php.net/manage/user-notes.php