Re: sorting array problem
| From: | Merlin | Date: | Thu, 17 Apr 2003 14:45:45 +0000 |
| Subject: | Re: sorting array problem | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-144290@lists.php.net to get a copy of this message | ||
Thanx Peter,
I have found a solution doing this by a tmp table in mysql. That way I get
more flexebility.
Thanx again for your help,
Merlin
"Peter Pistorius" <peterp@podbox.co.za> schrieb im Newsbeitrag
news:20030417102027.298.qmail@pb1.pair.com...
> <?php
>
> $timestamp = array();
>
> for ($i = 0; $i < 10; $i++)
> {
> $timestamp[time()+rand(0,999)] = $i;
> }
>
> // krsort() for descending key sort, ksort() for ascending.
> krsort($timestamp);
>
> foreach ($timestamp AS $key=>$value)
> {
> echo "$key -> $value = ";
> echo date('Y-m-d @ G:i', $key).'<br />';
> }
>
> ?>
>
>