this is my array:
$myarr = array(
4 => 3,
2 => 9,
7 => 8,
1 => 1
);
when i do:
asort($myarr);
$ myarr becomes:
array(
1 => 1,
2 => 9,
4 => 3,
7 => 8
);
This is not how it should work, is it? the values ββmust be sorted and the keys stored, while the opposite happens - just like ksort. What is the problem?
Please help me.
thank
source
share