note 90925 added to function.strtr

From: Date: Sat, 16 May 2009 15:55:08 +0000
Subject: note 90925 added to function.strtr
Groups: php.notes 
Request: Send a blank email to php-notes+get-154671@lists.php.net to get a copy of this message
fixed "normaliza" functions written below to include Slavic Latin characters... also, it doesn't return lowercase any more (you can easily get that by applying strtolower yourself)... also, renamed to normalize() <?php function normalize ($string) { $table = array( 'Š'=>'S', 'š'=>'s', 'Đ'=>'Dj', 'đ'=>'dj', 'Ž'=>'Z', 'ž'=>'z', 'Č'=>'C', 'č'=>'c', 'Ć'=>'C', 'ć'=>'c', 'À'=>'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', 'Ŕ'=>'R', 'ŕ'=>'r', ); return strtr($string, $table); } ?> ---- Server IP: 193.198.184.18 Probable Submitter: 93.136.18.181 ---- Manual Page -- http://www.php.net/manual/en/function.strtr.php Edit -- https://master.php.net/note/edit/90925 Del: integrated -- https://master.php.net/note/delete/90925/integrated Del: useless -- https://master.php.net/note/delete/90925/useless Del: bad code -- https://master.php.net/note/delete/90925/bad+code Del: spam -- https://master.php.net/note/delete/90925/spam Del: non-english -- https://master.php.net/note/delete/90925/non-english Del: in docs -- https://master.php.net/note/delete/90925/in+docs Del: other reasons-- https://master.php.net/note/delete/90925 Reject -- https://master.php.net/note/reject/90925 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#154671) next »