Re: sort(ing)
| From: | James Atkinson | Date: | Thu, 06 Jul 2000 23:08:10 +0000 |
| Subject: | Re: sort(ing) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-5284@lists.php.net to get a copy of this message | ||
On Thu, 06 Jul 2000, Ed Vul wrote:
> well i looked on the php manual pages, and i think I missed something
> because i didnt see a sort function that sorts by numerical value, not ASC
> II...
> Yes im stupid, but can you clear this up for me?
> Is there a sort function that would sort these numbers:
> 1,5,45,123,457,34,9
> in this order:
> 1,5,9,34,45,123,457
> instead of:
> 1,123,34,45,457,5,9 ?
>
> Or do i have to define my own?
> thanks
> Ed
You can put all the values into an array (if you have that string use
explode()) then use sort() on them. Check the function referance under array
functions for info on sort()
Or you can write a simple bubble sort... :)
--
- James Atkinson
'Today is an illusion, it is but an echo of yesterday and a shadow on tommorow'
http://www.totalgeek.org