|
Posted by ZeldorBlat on 10/22/55 12:00
On Jan 16, 10:40 am, jodleren <sonn...@hot.ee> wrote:
> Hi!
>
> I user sort() but it gives me all uppercase items first.
> Looking athttp://ee.php.net/manual/en/function.sort.phpI cannot find
> what I need - tried natcasesort, but that was even more
> interesting....
>
> sort gives me (yes, I am aware of the spelling error)
>
> Doc manager
> Doc manger more
> Tango
> brugs
>
> while natcasesort gives me
>
> Doc manager
> Tango
> Doc manger more
> brugs
>
> and I want
>
> brugs
> Doc manager
> Doc manger more
> Tango
>
> just as my alphabet is :-)
> What should I user...
How about this (untested):
$arr = array('foo', 'bar', 'Baz');
usort($arr, create_function('$v1,$v2', 'return strcasecmp($v1,
$v2);'));
[Back to original message]
|