How do I sort the "name" field in ASC and also sort in DESC ordering using only php?
Here is what I have thus far
$stud = json_encode($arr);
print_r($stud);
Which outputs..
[{"id":1, "name":"Some Name"},
{"id":4, "name":"Another Name"},
{"id":9, "name":"Third Name"}]
But this is what I need
[{"id":4, "name":"Another Name"},
{"id":1, "name":"Some Name"},
{"id":9, "name":"Third Name"}];
How would I sort the name column alphabetically after json_encode()?