title: php array_multisort() by 2 field
body: <p>I use array_multisort() function to sort an array by a field value. what I need is to sort it by 2 field values, by date and by time.
  here is the structure of the array:</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [id_art] =&gt; 5292
              [free_art] =&gt; 0
              [apero_art] =&gt; 0
              [name_cat] =&gt; Teatro
              [date_dat] =&gt; 2010-11-24
              [date2_dat] =&gt; 0000-00-00
              [name_spa] =&gt; Cinema Teatro
              [title_int] =&gt; Il piacere dell'onestÃ 
              [id_cat] =&gt; 2
              [time_tim] =&gt; 20:30:00
              [intro_int] =&gt; Una produzione Teatro Eliseo di Roma - ChiassoCultura 
              [image_art] =&gt; noimage.png
          )
  
      [1] =&gt; Array
          (
              [id_art] =&gt; 4983
              [free_art] =&gt; 0
              [apero_art] =&gt; 0
              [name_cat] =&gt; Cinema
              [date_dat] =&gt; 2011-04-20
              [date2_dat] =&gt; 2011-04-20
              [name_spa] =&gt; Cinema Morettina
              [title_int] =&gt; Inland Empire
              [id_cat] =&gt; 1
              [time_tim] =&gt; 20:30:00
              [intro_int] =&gt; Rassegna dedicata a David Lynch
              [image_art] =&gt; noimage.png
          )
  
      [2] =&gt; Array
          (
              [id_art] =&gt; 4983
              [free_art] =&gt; 0
              [apero_art] =&gt; 0
              [name_cat] =&gt; Cinema
              [date_dat] =&gt; 2011-04-22
              [date2_dat] =&gt; 2011-04-22
              [name_spa] =&gt; Cinema Iride
              [title_int] =&gt; Inland Empire
              [id_cat] =&gt; 1
              [time_tim] =&gt; 17:00:00
              [intro_int] =&gt; Rassegna dedicata a David Lynch
              [image_art] =&gt; noimage.png
          )....
  </code></pre>
  
  <p>What I do now is:</p>
  
  <pre><code>function array_sort_by_column(&amp;$arr, $col, $dir = SORT_ASC) {
      $sort_col = array();
      foreach ($arr as $key=&gt; $row) {
          $sort_col[$key] = $row[$col];
      }
      array_multisort($sort_col, $dir, $arr); 
  }
  </code></pre>
  
  <p>How can I easily make in one time the double sort?</p>
  
  <p>Thanks.</p>