Ask a Question related to PHP Development, Design and Development.
-
Steve Buehler #1
Re: [PHP] case insensitive sort
Ok. Now I REALLY feel like an idiot. Thanks so much for your help.
Steve
At 05:46 PM 8/26/2003 +0200, you wrote:>It right there under your nose:
>strcasecmp()
>
>Steve Buehler wrote:
>>>>I am using the following function for a sort on an array. I hope someone
>>can help me out here and let me know how to change it to make it a "case
>>insensitivie" sort. Right now, it is "case sensitive" so the sort of the
>>array will put the Capital letters first. Here are the results of the search:
>>Buehler, Steve
>>Buehler, Steve
>>Teste, Teste
>>a, a
>>asdf, adsf
>>asdf, asdf
>>dsdlkj, sd
>>Here is the code to sort:
>>$GLOBALS[sortterm]="cont_name";
>>usort($logins, "cmp");
>>function cmp ($a, $b) {
>>GLOBAL $sortterm;
>> return strcmp($a[$sortterm], $b[$sortterm]);
>>}
>>Thanks
>>Steve
>
>--
>This message has been scanned for viruses and
>dangerous content by the MailScanner at ow4, and is
>believed to be clean.Steve Buehler Guest
-
case insensitive REPLACE(...)?
Hi, I need to search and replace a web address, but the original address could be in any case. Is there a way of doing a case insensitive search... -
problems with case insensitive tr/// regexp
I'm trying to create a script to remove all font tags from an HTML documents. I created a regular expression like this: ,----[ working code |... -
#23026 [Com]: Make Zend case-sensitive (classes, functions, remove case-insensitive)
ID: 23026 Comment by: nvivo at mandic dot com dot br Reported By: mfischer@php.net Status: Open Bug Type: ... -
Case-insensitive str_replace
Hi, I'm trying to replace strings in a body of html. These strings may contain spaces. str_replace works perfectly, except that it is... -
case-insensitive sort
How I can implement case-insensitive sort without use function-based index?



Reply With Quote

