|
Posted by jodleren on 10/12/32 12:00
On Jan 16, 6:49 pm, ZeldorBlat <zeldorb...@gmail.com> wrote:
> 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.phpIcannot find
> > what I need - tried natcasesort, but that was even more
> > interesting....
>
> How about this (untested):
>
> $arr = array('foo', 'bar', 'Baz');
> usort($arr, create_function('$v1,$v2', 'return strcasecmp($v1,
> $v2);'));- Hide quoted text -
>
Yep, that does it. Thanks
I implemented it as this, which makes it work as a normal sort.
function my_sort(&$arr)
{
usort($arr, create_function('$v1,$v2', 'return
strcasecmp($v1,$v2);'));
}
Navigation:
[Reply to this message]
|