note 48043 deleted from function.ereg-replace by sean

From: Date: Thu, 09 Dec 2004 20:38:09 +0000
Subject: note 48043 deleted from function.ereg-replace by sean
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-81611@lists.php.net to get a copy of this message
Note Submitter: webmaster at elcurriculum dot com ---- This function returns the text without accents. Ideal for other languages. //Quitar accentos de un texto.... function GetQuitarAcentos($s) { $s = ereg_replace("[áàâãª]","a",$s); $s = ereg_replace("[ÁÀÂÃ]","A",$s); $s = ereg_replace("[ÍÌÎ]","I",$s); $s = ereg_replace("[íìî]","i",$s); $s = ereg_replace("[éèê]","e",$s); $s = ereg_replace("[ÉÈÊ]","E",$s); $s = ereg_replace("[óòôõº]","o",$s); $s = ereg_replace("[ÓÒÔÕ]","O",$s); $s = ereg_replace("[úùû]","u",$s); $s = ereg_replace("[ÚÙÛ]","U",$s); $s = str_replace("ç","c",$s); $s = str_replace("Ç","C",$s); return $s; } Example: echo GetQuitarAcentos("Artículos"); //Return: Articulos More in: http://tryke.blogcindario.com ---- Reason: bad code

« previous php.notes (#81611) next »