how to sort json array in php?
<p>How do I sort the "name" field in ASC and also sort in DESC ordering using only php?</p>

<p>$stud = json_encode($arr);
print_r($stud);</p>

<p>output: [{"id":1, "name":"Some Name"},
          {"id":4, "name":"Another Name"},
          {"id":9, "name":"Third Name"}]</p>

<p>i need this type</p>

<p>$stud = [ {"id":4, "name":"Another Name"},
          {"id":1, "name":"Some Name"},
          {"id":9, "name":"Third Name"}];</p>

<p>how i sort after json_encode? tell anyone your suggestion</p>
