note 65414 deleted from function.str-replace by bjori

From: Date: Sun, 30 Apr 2006 13:39:18 +0000
Subject: note 65414 deleted from function.str-replace by bjori
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-110181@lists.php.net to get a copy of this message
Note Submitter: dmitry at dest dot by Reason: non-english ---- Function for small texts. function cyr2lat($str) { $str = trim($str); $str = strtolower($str); $str = str_replace("а", "a", $str); $str = str_replace("б", "b", $str); $str = str_replace("в", "v", $str); $str = str_replace("г", "g", $str); $str = str_replace("д", "d", $str); $str = str_replace("е", "e", $str); $str = str_replace("ё", "e", $str); $str = str_replace("ж", "j", $str); $str = str_replace("з", "z", $str); $str = str_replace("и", "i", $str); $str = str_replace("й", "i", $str); $str = str_replace("к", "k", $str); $str = str_replace("л", "l", $str); $str = str_replace("м", "m", $str); $str = str_replace("н", "n", $str); $str = str_replace("о", "o", $str); $str = str_replace("п", "p", $str); $str = str_replace("р", "r", $str); $str = str_replace("с", "s", $str); $str = str_replace("т", "t", $str); $str = str_replace("у", "y", $str); $str = str_replace("ф", "f", $str); $str = str_replace("х", "h", $str); $str = str_replace("ц", "c", $str); $str = str_replace("ч", "ch", $str); $str = str_replace("ш", "sh", $str); $str = str_replace("щ", "sch", $str); $str = str_replace("ъ", "", $str); $str = str_replace("ы", "i", $str); $str = str_replace("ь", "'", $str); $str = str_replace("э", "e", $str); $str = str_replace("ю", "u", $str); $str = str_replace("я", "ya", $str); $str = str_replace("—", "_", $str); return $str; } $stri = "Обыкновенный пример"; $stri = cyr2lat($stri); print $stri;

« previous php.notes (#110181) next »