Hey, If in php I'm returning a loop of numbers say about 500, How could I show the number that appears the most and the number that appears least within the sequence of these numbers? Also if there's more than 1 appears the least times then show both. Thanks for your help!
Example with the following number sequence: 1, 2, 2, 2, 4, 5, 5, 5, 5, 6, 6, 6, 7, 8, 8, 9, 9 ,9 ,9 Lowest Appearing numbers 1, 7 Highest Appearing Numbers 9
My first guess would be to use a counter: $numberarray = array("0" -> "0", "1" => "1"); // etc.. Increase each one when looping: numberarray[$loopnumbers][0]++; Then just arsort and take it from there. Peace,