I'm really stuck with this. I have this script:
result is
5
9
8
It works perfectly, but i want to be able to reduce the number of the results.
Instead of all 3 values, i want to let it sort the array values but echo just the first 2 values. Is it possible?
Code:
$alpha = array(6=>8, 1=>5, 2=>9);
ksort($alpha);
foreach ($alpha as $key => $val)
{echo "$val<br />\n";}
result is
5
9
8
It works perfectly, but i want to be able to reduce the number of the results.
Instead of all 3 values, i want to let it sort the array values but echo just the first 2 values. Is it possible?
Comment