<?php
$data = array(
array(
"id" => 1,
"name" => "Bruce Wayne",
"city" => "Gotham",
"gender" => "Male"
),
array(
"id" => 2,
"name" => "Diana Prince",
"city" => "Gotham",
"gender" => "Male"
),
array(
"id" => 4,
"name" => "Speedy Gonzales",
"city" => "New Mexico",
"gender" => "Male"
),
array(
"id" => 3,
"name" => "Diana Prince",
"city" => "New Mexico",
"gender" => "Female"
),
array(
"id" => 5,
"name" => "Bruce Wayne",
"city" => "Gotham",
"gender" => "Male"
),
);
array_multisort(array_column($data, "name"), SORT_ASC, $data);
print_r($data);
preferences:
59.25 ms | 406 KiB | 5 Q