Re: if((strtolower(substr($author, 0, 1)) == $ausenquiry))
| From: | Skippy | Date: | Sat, 17 Jul 2004 15:39:39 +0000 |
| Subject: | Re: if((strtolower(substr($author, 0, 1)) == $ausenquiry)) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-190855@lists.php.net to get a copy of this message | ||
On Mon, 12 Jul 2004 15:22:05 -0400 John Taylor-Johnston
<taylorjo@collegesherbrooke.qc.ca> wrote:
> So how would I recode $ausenquiry so if ausenquiry=e, it will choose words
> that begin with "e", "é" sorted this way:
Before the actual sort, use strtr() with a translation array on a copy of the
string. Use the strtr() to transform all occurances of similar characters to
only one ie. "é" becomes "e". Then you can search for "e" and it will
match.
If you have special characters in the search string too, use the translation
for it as well. Basically, it's all about bringing the strings you work with
to a common denominator.
--
Skippy - Romanian Web Developers - http://ROWD.ORG