Re: Re: Sorting times
| From: | German Geek | Date: | Sun, 15 Feb 2009 23:55:56 +0000 |
| Subject: | Re: Re: Sorting times | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-288292@lists.php.net to get a copy of this message | ||
Yes, you are right. Hadn't thought about that. But usort is probably better
than making your own sort function because it uses the quick sort algorithm
i believe which is quite efficient. That was the other suggestion...
Tim-Hinnerk Heuer
http://www.ihostnz.com
Fred Allen - "California is a fine place to live - if you happen to be an
orange."
2009/2/16 Mattias Thorslund <mattias@thorslund.us>
> German Geek wrote:
>
>> The easiest would probably to use
>> http://nz.php.net/manual/en/function.strnatcmp.php . It
>> would happen to
>> sort
>> it the right way because am is before pm ;-).
>>
>>
>
>
> Nope. Unfortunately 12 am (midnight) comes before 1 am, and 12 pm (noon)
> comes before 1 pm. Since you have to account for that, you solution won't be
> as elegant.
>
> Cheers,
>
> Mattias
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>