Ulli at Stemmeler dot net
06-Apr-2002 12:01
natcasesort didn't work first time I needed something like this.
Not on
my local server, not on my server on the web.
I needed an array sorted
ignoring upper and lower cases. In the end lower case array-members stayed
at the end of the array.
I replaced it with this
function:
---------
function ignorecasesort(&$array)
{
$separator="|<>|";
for($i=0;$i<sizeof($array);$i++)
{ $array[$i]=strtolower($array[$i]).$separator.$array[$i];
}
sort($array);
for($i=0;$i<sizeof($array);$i++) {
$this=$array[$i]; $this=explode($separator,$this); $array[$i]=$this[1];
}
}
---------