I have the following array I want to sort by value, A to Z, and store in a new arary $atoz_people:
$people = (
[0] => Array
(
[id] => 1
[name] => Ken
)
[1] => Array
(
[id] => 2
[name] => Anne
)
[2] => Array
(
[id] => 3
[name] => Bob
)
);
I used the "classic" asort($people):
$atoz_people = $people;
asort($atoz_people);
print_r($atoz_people);
It does not work, unfortunately. What shall I change in order to get the array below? Is it even possible?
$atoz_people = (
[1] => Array
(
[id] => 2
[name] => Anne
)
[2] => Array
(
[id] => 3
[name] => Bob
)
[0] => Array
(
[id] => 1
[name] => Ken
)
);