Re: sorting an array
| From: | CPT John W. Holmes | Date: | Tue, 17 Jun 2003 16:35:44 +0000 |
| Subject: | Re: sorting an array | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-151859@lists.php.net to get a copy of this message | ||
> > array[numrooms] => Array ( [3] => 2 [2] => 5 [1] => 1 )
> > I want to get a result like this:
> > 2=>5
> > 3=>2
> > 1=>1
> > ( I want the keys to stay attached to the results)
>
> perhaps asort()?
> "This function sorts an array such that array indices maintain their
> correlation with the array elements they are associated with."
Or arsort(), which will sort them in decending order.
---John Holmes...