<?php
$array = array('one'=>'1','three'=>'3','seven'=>'7','two'=>'2');
print_r($array);
asort($array);
print_r($array);
?>
echo "<pre>UNSORTED:\r\n";
print_r($thing);
echo "\r\nSORTED:\r\n";
asort($thing, SORT_NUMERIC);
print_r($thing);
echo "</pre>";
<pre>UNSORTED:
Array
(
[yahoo] => 4
[opera 9.22] => 9
[internet explorer 7.0] => 12
[internet explorer 6.0] => 29
)
SORTED:
Array
(
[yahoo] => 4
[opera 9.22] => 9
[internet explorer 7.0] => 12
[internet explorer 6.0] => 29
)
</pre>
Mikor said:Still not working
PHP:echo "<pre>UNSORTED:\r\n"; print_r($thing); echo "\r\nSORTED:\r\n"; asort($thing, SORT_NUMERIC); print_r($thing); echo "</pre>";
Outputs:
Code:<pre>UNSORTED: Array ( [yahoo] => 4 [opera 9.22] => 9 [internet explorer 7.0] => 12 [internet explorer 6.0] => 29 ) SORTED: Array ( [yahoo] => 4 [opera 9.22] => 9 [internet explorer 7.0] => 12 [internet explorer 6.0] => 29 ) </pre>



