![Contoh Mengurutkan data kecil ke bawah dengan php array](https://ullilfahri.b-cdn.net/storage/app/photos/ullil.png)
Contoh Mengurutkan data kecil ke bawah dengan php array
$data = array(
0 => array(
"_id" => "mata_pelajaran-324fe9fab3a64b78c9ef34dc37700e92-27-190324",
"_rev" => "1-2782b5f3c3ba441b629c78e5affce07c",
"table" => "mata_pelajaran",
"data" => array(
"nama_mata_pelajaran" => "MULOK",
"relasi" => "1",
"urut" => 27,
"_token" => "kqBtp3vviUhCj2MsZszTlqHUhTrgYcXwRA2om4nU"
)
),
1 => array(
"_id" => "mata_pelajaran-06e9ad014cc8ee70c6339044d303aa23-26-190324",
"_rev" => "1-735bceb984549765cb8ec0abac4b8f12",
"table" => "mata_pelajaran",
"data" => array(
"nama_mata_pelajaran" => "PRAKARYA DAN/ATAU INFORMATIKA",
"relasi" => "1",
"urut" => 26,
"_token" => "kqBtp3vviUhCj2MsZszTlqHUhTrgYcXwRA2om4nU"
)
)
);
usort($data, function ($a, $b) {
return $a['data']['urut'] <=> $b['data']['urut'];
});
print_r($data);
Lanjut Part : 1
Muhammad Ullil Fahri
WA : 089696380422
Tautan WA : https://wa.me/message/SG4YA2XQP5FPE1