I'm looking for sort an array WITHOUT foreach loop (direct command)...
for example :
<?php
$sortme = array( 10, 8, 17, 6, 22, 4, 3, 87, 1);
asort($sortme);
echo $sortme[0]; //Why this is not the lowest value (which is 1 on this case) ?!
//Is there any direct command sort array WITHOUT foreach loop ?
// iow...
// I need this :
// $sortme = array( 10, 8, 17, 6, 22, 4, 3, 87, 1);
// (here is the magic command) to become this :
// $sortme = array( 1, 3, 4, 6, 8, 10, 17, 22, 87);
?>
Thanks !
Here's one way you could do this:
Should give you this output: