PHP sort an array of arrays according to an index in the arrays
Question
Let's say you have an array that looks like this:
$myArray []= array('firstname' => 'John' , 'lastname'=> 'Johnson');
$myArray []= array('firstname' => 'Adam' , 'lastname'=> 'Tyson');
$myArray []= array('firstname' => 'Mike' , 'lastname'=> 'Robinson');
$myArray []= array('firstname' => 'David' , 'lastname'=> 'Jackson');
How can you sort $myArray according to the lastname?
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow