RE: [PHP] Converting accented characters or numeric equivalents to non-accented

From: Date: Sat, 18 Jan 2003 18:41:40 +0000
Subject: RE: [PHP] Converting accented characters or numeric equivalents to non-accented
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-132116@lists.php.net to get a copy of this message
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.

« previous php.general (#132116) next »