note 36945 added to function.str-replace

From: Date: Tue, 28 Oct 2003 11:30:39 +0000
Subject: note 36945 added to function.str-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-59416@lists.php.net to get a copy of this message
/* Conversione di caratteri speciali nel formato ISO Latin-1 e vv. Forse una funzione simile esiste ma non sono riuscito a trovarla nel manuale. Special characters conversion into ISO Latin-1 set e vv. Exist a built-in function like this? I don't found. Special thanks to kerxen at caramail dot com Eddy Cingala */ function toIsoLatin ($text) { $specar = array ( 'à','á','â','ã','ä','å','æ','ç', 'è','é','ê','ë','ì','í','î','ï', '?','ñ','ò','ó','ô','õ','ö','÷' , 'ø','ù','ü','ú','?','ÿ', 'À','Á','Â','Ã','Ä','Å','Æ','Ç', 'È','É','Ê','Ë','Ì','Í','Î','Ï', '?','Ñ','Ò','Ó','Ô','Õ','Ö', '?','Ø','Ù','Ü','Ú','?','ß'); $ampcar = array ('à','á','â','ã', 'ä', 'å','æ', 'ç','è','é','ê', 'ë', 'ì', 'í','î','ï','?','ñ', 'ò', 'ó', 'ô','õ','ö','/','ø', 'ù', 'ü', 'ú','?','ÿ','À','Á', 'Â', 'Ã', 'Ä','Å','Æ','Ç', 'È', 'É', 'Ê','Ë','Ì','Í', 'Î', 'Ï','?', 'Ñ','Ò','Ó','Ô', 'Õ', 'Ö', '?','Ø','Ù','Ü','Ú','?', 'ß'); return str_replace($specar, $ampcar, $text); } function fromIsoLatin ($text) { $specar = array ( 'à','á','â','ã','ä','å','æ','ç', 'è','é','ê','ë','ì','í','î','ï', '?','ñ','ò','ó','ô','õ','ö','÷' , 'ø','ù','ü','ú','?','ÿ', 'À','Á','Â','Ã','Ä','Å','Æ','Ç', 'È','É','Ê','Ë','Ì','Í','Î','Ï', '?','Ñ','Ò','Ó','Ô','Õ','Ö', '?','Ø','Ù','Ü','Ú','?','ß'); $ampcar = array ('à','á','â','ã', 'ä', 'å','æ', 'ç','è','é','ê', 'ë', 'ì', 'í','î','ï','?','ñ', 'ò', 'ó', 'ô','õ','ö','/','ø', 'ù', 'ü', 'ú','?','ÿ','À','Á', 'Â', 'Ã', 'Ä','Å','Æ','Ç', 'È', 'É', 'Ê','Ë','Ì','Í', 'Î', 'Ï','?', 'Ñ','Ò','Ó','Ô', 'Õ', 'Ö', '?','Ø','Ù','Ü','Ú','?', 'ß'); return str_replace($ampcar, $specar, $text); } ---- Manual Page -- http://www.php.net/manual/en/function.str-replace.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+36945 Delete -- http://master.php.net/manage/user-notes.php?action=delete+36945&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+36945&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#59416) next »