Jump to content

Archived

This topic is now archived and is closed to further replies.

ssjskipp

Ordering Numbers

Recommended Posts

I've got a list of about 350+ numbers, and there' in the 700-800's, but I'd like to know how to do a ffew things:
Order them form least to greatest
AND // OR
Count how many times each number appears, and display the results.

How would I go about doing this?

Share this post


Link to post
Share on other sites
Put them into an array.

To put them in order, [a href=\"http://www.php.net/sort\" target=\"_blank\"]http://www.php.net/sort[/a]

To count, [a href=\"http://www.php.net/array_count_values\" target=\"_blank\"]http://www.php.net/array_count_values[/a]

Share this post


Link to post
Share on other sites
[!--quoteo(post=351783:date=Mar 5 2006, 04:35 AM:name=Barand)--][div class=\'quotetop\']QUOTE(Barand @ Mar 5 2006, 04:35 AM) [snapback]351783[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Put them into an array.

To put them in order, [a href=\"http://www.php.net/sort\" target=\"_blank\"]http://www.php.net/sort[/a]

To count, [a href=\"http://www.php.net/array_count_values\" target=\"_blank\"]http://www.php.net/array_count_values[/a]
[/quote]

thank you =]

Share this post


Link to post
Share on other sites
[!--quoteo(post=351891:date=Mar 5 2006, 04:40 PM:name=Barand)--][div class=\'quotetop\']QUOTE(Barand @ Mar 5 2006, 04:40 PM) [snapback]351891[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Are your 350+ numbers in a database table?
[/quote]

Sadly, no =[!
But I got them sorted and counted, thanks =]

If they were in the database, I'd do something like
SELECT * FROM `table` ORDER BY `num` ASC
or something....

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.