RE: [PHP] ASCII/UNICODE Character Translation Comparison in Strings
| From: | Dennis Cole | Date: | Wed, 18 Apr 2001 23:29:53 +0000 |
| Subject: | RE: [PHP] ASCII/UNICODE Character Translation Comparison in Strings | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-136091@lists.php.net to get a copy of this message | ||
$txt = "björk";
$txt = strtr($txt,
"ÁÉÍÓÚÑÀÈÌÒÙÄËÏÖÜÂÊÎÔÛáéíóúñàèìòùäëïöüâêîôûç",
"aeiounaeiouaeiouaeiouaeiounaeiouaeiouaeiouc");
echo $txt; // Returns "bjork"
-----Original Message-----
From: Chris McCluskey [mailto:chris@modulusgroup.com]
Sent: Tuesday, February 18, 2003 7:03 PM
To: php-general@lists.php.net
Cc: Flint Doungchak; Ethan Nelson
Subject: [PHP] ASCII/UNICODE Character Translation Comparison in Strings
Hello, I was wondering if there are any native PHP functions that will
acomplish what I have set out to do here:
I have an issue where I would need to compare international characters, for
instance i would want "björk" to match "bjork", i would want ô,ö, and ò to
match o; ñ, Ñ to match n. etc...
I could just create a function that would do this, and I already have ideas
about how to go about this, but before i start coding, i want to make sure
there isn't something that PHP does already that could replace what i'm
trying to do here.
Thanks
(yes, i googled already) ;-)
-Chris
-----------------------------------
_ _ _ _
|'|(_)|_)(_)|_(_)`-,
* * *
------------------------------------
Chris McCluskey Web Applications Engineer
Modulus, LLC
1720 Willow Creek Circle, Suite 520
Eugene, OR 97402
Email: chris@modulusgroup.com
Voice: +1 (541) 434-1024
Web..: http://www.modulusgroup.com <http://www.modulusgroup.com/>
============================================
The contents of this transmission may be
confidential in nature and should be
directed only to the person to whom it is
addressed. Do not read, copy, or disseminate
this material unless you are the intended
recipient. If this transmission reached you
in error, please forward the e-mail to the
sender to advise, then destroy the
transmission you received. Thank you.