Ver Mensaje Individual
  #7 (permalink)  
Antiguo 01/03/2005, 12:16
HiperJP
 
Fecha de Ingreso: enero-2004
Ubicación: Santiago
Mensajes: 127
Antigüedad: 21 años, 1 mes
Puntos: 0
Tomado de http://www.php.net/str_replace


Código PHP:
function unaccent($text) {
$trans get_html_translation_table(HTML_ENTITIES); // Get the entities table into an array
    
foreach ($trans as $literal => $entity) {         // Create two arrays, for accented and unaccented forms
       
if (ord($literal) >= 192){                     // Don't contemplate other characters such as fractions, quotes etc
         
$replace[] = substr($entity,1,1);             // Get 'E' from string '&Eaccute' etc.
         
$search[] = $literal;                        // Get accented form of the letter
        
}
    }
return 
str_replace($search$replace$text);

Saludos