This is an array that looks for the first array and in that array has an element called ‘name’
1 2 3 4 5 |
usort($results, function($a, $b) { return strcasecmp($a[0]['name'], $b[0]['name']); }); |
For a simpler version (notice the array number [0] is missing now)
1 2 3 4 5 6 |
usort($data, function($a, $b) { return strcasecmp($a['name'], $b['name']); }); } |