Re: sort(ing)
| From: | Ed Vul | Date: | Thu, 06 Jul 2000 23:19:12 +0000 |
| Subject: | Re: sort(ing) | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-5285@lists.php.net to get a copy of this message | ||
You must have misunderstood me... these are in an array, and sort() sorts
them in the manner of:
1,123,34,45,457,5,9
I think it is intended for alphabetical sorting...
is there some numerical sorting function?
"James Atkinson" <james@totalgeek.org> wrote in message
news:00070617100200.13860@wintermute.totalgeek.org...
> 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
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>