title: sort multidimensional array by date
body: <p>I have this <code>array</code>:-</p>
  
  <pre><code>array (size=8)
    0 =&gt; 
      array (size=2)
        'date' =&gt; string '17/05/2016 00:00:00' (length=19)
        'reason' =&gt; string 'DNA' (length=3)
    1 =&gt; 
      array (size=2)
        'date' =&gt; string '10/05/2016 00:00:00' (length=19)
        'reason' =&gt; string 'UTA' (length=3)
    2 =&gt; 
      array (size=2)
        'date' =&gt; string '03/05/2016 00:00:00' (length=19)
        'reason' =&gt; string 'DNA' (length=3)
    3 =&gt; 
      array (size=2)
        'date' =&gt; string '26/04/2016 00:00:00' (length=19)
        'reason' =&gt; string 'true' (length=4)
    4 =&gt; 
      array (size=2)
        'date' =&gt; string '31/05/2016 00:00:00' (length=19)
        'reason' =&gt; string 'true' (length=4)
    5 =&gt; 
      array (size=2)
        'date' =&gt; string '24/05/2016 00:00:00' (length=19)
        'reason' =&gt; string 'true' (length=4)
    6 =&gt; 
      array (size=2)
        'date' =&gt; string '07/06/2016 00:00:00' (length=19)
        'reason' =&gt; string 'true' (length=4)
    7 =&gt; 
      array (size=2)
        'date' =&gt; string '14/06/2016 00:00:00' (length=19)
        'reason' =&gt; string 'true' (length=4)
  </code></pre>
  
  <p>I want to sort it by 'date'</p>
  
  <p>I tried both of the following methods, but the result ( below )is not sorted correctly.</p>
  
  <pre><code>usort($course, function($a, $b) {
      return $a['date'] - $b['date'];
  });
  
  _______________________________
  function date_compare($a, $b)
  {
      $t1 = strtotime($a['date']);
      $t2 = strtotime($b['date']);
      return $t1 - $t2;
  }
  usort($course, 'date_compare');
  </code></pre>
  
  <p>This is the "sorted" array</p>
  
  <pre><code>array (size=8)
    0 =&gt; 
      array (size=2)
        'date' =&gt; string '24/05/2016 00:00:00' (length=19)
        'reason' =&gt; string 'true' (length=4)
    1 =&gt; 
      array (size=2)
        'date' =&gt; string '14/06/2016 00:00:00' (length=19)
        'reason' =&gt; string 'true' (length=4)
    2 =&gt; 
      array (size=2)
        'date' =&gt; string '31/05/2016 00:00:00' (length=19)
        'reason' =&gt; string 'true' (length=4)
    3 =&gt; 
      array (size=2)
        'date' =&gt; string '26/04/2016 00:00:00' (length=19)
        'reason' =&gt; string 'true' (length=4)
    4 =&gt; 
      array (size=2)
        'date' =&gt; string '17/05/2016 00:00:00' (length=19)
        'reason' =&gt; string 'DNA' (length=3)
    5 =&gt; 
      array (size=2)
        'date' =&gt; string '03/05/2016 00:00:00' (length=19)
        'reason' =&gt; string 'DNA' (length=3)
    6 =&gt; 
      array (size=2)
        'date' =&gt; string '07/06/2016 00:00:00' (length=19)
        'reason' =&gt; string 'true' (length=4)
    7 =&gt; 
      array (size=2)
        'date' =&gt; string '10/05/2016 00:00:00' (length=19)
        'reason' =&gt; string 'UTA' (length=3)
  </code></pre>