another one for you

function removeaccents($string) {
   return strtr($string,
     "SOZsozY¥µÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ",
     "SOZsozYYuAAAAAAACEEEEIIIIDNOOOOOOUUUUYsaaaaaaaceeeeiiiionoooooouuuuyy");
}

Best Wishes & Happy New Year

Paul Roberts
[EMAIL PROTECTED]
++++++++++++++++++++++++
----- Original Message ----- 
From: "Ian M. Evans" <[EMAIL PROTECTED]>
To: "Ernest E Vogelsinger" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, January 18, 2003 6:41 PM
Subject: RE: [PHP] Converting accented characters or numeric equivalents to 
non-accented


Ernest E. Vogelsinger suggested:
>$chars_in = array('Á',''á','É','é');  // you get it
>$chars_out = array('A','a','E','e');  // this too
>preg_replace($chars_in, $chars_out, $string_to_parse);

I initially got a 'no ending delimiter' error but after adding /'s to the
$chars_in it was just what the doctor ordered.

I'm actually a little surprised that there isn't a built-in function, say,
strip_accent(). I'd assume a lot of people would need this at some time or
another.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to