Hi Ian M. Evans,
On Fri, 17 Jan 2003 14:04:15 -0500, you wrote about [PHP] Converting
accented characters or numeric equivalents to non-accented something that
looked like this:
Does anyone have a quick PHP function for converting accented characters to
their non-accented forms? It would really
-[ Rene Brehmer ]- wrote:
something like this (untested):
for ($i = 0; $i strlen($string_to_parse); $i++) {
$char = substr($string_to_parse, $i, 1);
if (ord($char) 128) {
$output_string .= #.ord($char).;;
}
else {
$output_string .= $char;
}
}
You may need to test for value 127 ...
Rene:
Thanks for the response. I guess I wasn't too clear in my original post. I'm
not looking to turn an accented letter into its numeric equivalent, I'm
looking to strip the accent so that Renée Zellweger becomes Renee Zellweger.
Any thoughts there?
--
PHP General Mailing List
At 17:25 18.01.2003, -[ Rene Brehmer ]- said:
[snip]
Not sure about quick, but the only way I've found that works with 100%
guarantee everytime is to take the string and check it character by
character, and if the ascii value is 128, simply replace it with
At 19:11 18.01.2003, Ian M. Evans said:
[snip]
Thanks for the response. I guess I wasn't too clear in my original post. I'm
not looking to turn an accented letter into its numeric equivalent, I'm
looking to strip the accent so that Renée Zellweger becomes
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
]
- 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
return strtr($string, SOZsozY...
Just curious why the search starts with unaccented SOZsozY?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
8 matches
Mail list logo