How do I sort the "name" field in ASC and also sort in DESC ordering using only php?
$stud = json_encode($arr); print_r($stud);
output: [{"id":1, "name":"Some Name"}, {"id":4, "name":"Another Name"}, {"id":9, "name":"Third Name"}]
i need this type
$stud = [ {"id":4, "name":"Another Name"}, {"id":1, "name":"Some Name"}, {"id":9, "name":"Third Name"}];
how i sort after json_encode? tell anyone your suggestion