ssjskipp Posted March 5, 2006 Share Posted March 5, 2006 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 greatestAND // ORCount how many times each number appears, and display the results.How would I go about doing this? Link to comment https://forums.phpfreaks.com/topic/4123-ordering-numbers/ Share on other sites More sharing options...
Barand Posted March 5, 2006 Share Posted March 5, 2006 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] Link to comment https://forums.phpfreaks.com/topic/4123-ordering-numbers/#findComment-14348 Share on other sites More sharing options...
ssjskipp Posted March 5, 2006 Author Share Posted March 5, 2006 [!--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 =] Link to comment https://forums.phpfreaks.com/topic/4123-ordering-numbers/#findComment-14453 Share on other sites More sharing options...
Barand Posted March 5, 2006 Share Posted March 5, 2006 Are your 350+ numbers in a database table? Link to comment https://forums.phpfreaks.com/topic/4123-ordering-numbers/#findComment-14454 Share on other sites More sharing options...
ssjskipp Posted March 5, 2006 Author Share Posted March 5, 2006 [!--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 likeSELECT * FROM `table` ORDER BY `num` ASCor something.... Link to comment https://forums.phpfreaks.com/topic/4123-ordering-numbers/#findComment-14456 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.