title: sort json results in foreach loop
body: <p>I am running a foreach loop to display json results, when certain conditions are met, and would like to sort them by the <code>name</code> field. I am trying <code>usort()</code>, but can't seem to figure it out.</p>
  
  <p>JSON:</p>
  
  <pre><code>{
      "Shawn Taylor":{
          "name":"Shawn Taylor",
          "title":"",
          "photo_url":"house_165 (1).jpg",
          },
      "Another Name": {
          "name":"Another Name",
          "title":"Title is here",
          "photo_url":"Person.jpg",
          }
  }
  </code></pre>
  
  <p>PHP: </p>
  
  <pre><code>$data_json = file_get_contents('data.json');
  $data_array = json_decode($data_json, true);
  $i = 0;
  foreach($data_array as $key =&gt; $person){
    if($person['title'] == 'some title'){
      include('card.php'); 
      if(++$i % 4 === 0) {
        echo '&lt;div class="clearfix"&gt;&lt;/div&gt;'; // inserts a clearfix every 4 cards
      }
    }
  }
  </code></pre>
  
  <p>So this returns the all the results I expect, but not sorted. I've tried usort() a few different ways, but just fell on my face terribly:) Please help!</p>