note 115988 added to function.strtr
| From: | Romain | Date: | Thu, 23 Oct 2014 09:44:27 +0000 |
| Subject: | note 115988 added to function.strtr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-200719@lists.php.net to get a copy of this message | ||
<?php
/**
* Clean string,
* minimize and remove space, accent and other
*
* @param string $string
* @return string
*/
public function mb_strtoclean($string){
// Valeur a nettoyer (conversion)
$unwanted_array = array( 'Å '=>'S',
'š'=>'s', 'Ž'=>'Z',
'ž'=>'z', 'Ã'=>'A',
'Ã'=>'A', 'Ã'=>'A',
'Ã'=>'A', 'Ã'=>'A',
'Ã
'=>'A', 'Ã'=>'A',
'Ã'=>'C', 'Ã'=>'E',
'Ã'=>'E',
'Ã'=>'E',
'Ã'=>'E', 'Ã'=>'I',
'Ã'=>'I', 'Ã'=>'I',
'Ã'=>'I', 'Ã'=>'N',
'Ã'=>'O', 'Ã'=>'O',
'Ã'=>'O', 'Ã'=>'O',
'Ã'=>'O', 'Ã'=>'O',
'Ã'=>'U',
'Ã'=>'U',
'Ã'=>'U', 'Ã'=>'U',
'Ã'=>'Y', 'Ã'=>'B',
'Ã'=>'Ss', 'Ã '=>'a',
'á'=>'a', 'â'=>'a',
'ã'=>'a', 'ä'=>'a',
'å'=>'a', 'æ'=>'a',
'ç'=>'c',
'è'=>'e',
'é'=>'e', 'ê'=>'e',
'ë'=>'e', 'ì'=>'i',
'Ã'=>'i', 'î'=>'i',
'ï'=>'i', 'ð'=>'o',
'ñ'=>'n', 'ò'=>'o',
'ó'=>'o', 'ô'=>'o',
'õ'=>'o',
'ö'=>'o',
'ø'=>'o', 'ù'=>'u',
'ú'=>'u', 'û'=>'u',
'ý'=>'y', 'ý'=>'y',
'þ'=>'b', 'ÿ'=>'y',
' ' => '', '_' =>
'', '-' => '', '.'=> '', ',' =>
'', ';' => '');
return mb_strtolower(strtr($string, $unwanted_array ));
}
----
Server IP: 195.221.21.36
Probable Submitter: 94.103.141.65
----
Manual Page -- http://php.net/manual/en/function.strtr.php
Edit -- https://master.php.net/note/edit/115988
Del: integrated -- https://master.php.net/note/delete/115988/integrated
Del: useless -- https://master.php.net/note/delete/115988/useless
Del: bad code -- https://master.php.net/note/delete/115988/bad+code
Del: spam -- https://master.php.net/note/delete/115988/spam
Del: non-english -- https://master.php.net/note/delete/115988/non-english
Del: in docs -- https://master.php.net/note/delete/115988/in+docs
Del: other reasons-- https://master.php.net/note/delete/115988
Reject -- https://master.php.net/note/reject/115988
Search -- https://master.php.net/manage/user-notes.php