Here is my code:
$numbers = array(10, 100, 100, 0);
$names = array("Alex", "Jane", "Amanda", "Debra");
array_multisort($numbers, $names);
print_r($numbers);
print_r($names);
The above code outputs:
Array
(
[0] => 0
[1] => 10
[2] => 100
[3] => 100
)
Array
(
[0] => Debra
[1] => Alex
[2] => Amanda
[3] => Jane
)
Why is the sorting of second array incorrect? If it is correct, could anyone explain how is it correct?
Thanks.