title: PHP sorting a multidimensional Array by 3 values
body: <p>I want to sort a mulitdimensional array by the values position (can only be 1 or 0), the date and the time. The arrays with position = 1 should be first, and they should be sorted by date and time. The array with position = 0 should come after the ones with position = 1 and should also be sorted by date and time</p>
  
  <pre><code>Array
  (
  [001] =&gt; Array
      (
          [position] =&gt; 1
          [Date] =&gt; 28.04.2013
          [Time] =&gt; 00:21:38
      )
  
  [002] =&gt; Array
      (
          [position] =&gt; 1
          [Date] =&gt; 28.04.2013
          [Time] =&gt; 00:27:07
      )
  
  [003] =&gt; Array
      (
          [position] =&gt; 0
          [Date] =&gt; 28.04.2013
          [Time] =&gt; 00:15:06
      )
  
  [004] =&gt; Array
      (
          [position] =&gt; 0
          [Date] =&gt; 28.04.2013
          [Time] =&gt; 00:26:09
      )
  </code></pre>
  
  <p>)</p>
  
  <p>Thats how I want the array to be after sorting:</p>
  
  <pre><code>Array
  (
  [002] =&gt; Array
      (
          [position] =&gt; 1
          [Date] =&gt; 28.04.2013
          [Time] =&gt; 00:27:07
      )
  
  [001] =&gt; Array
      (
          [position] =&gt; 1
          [Date] =&gt; 28.04.2013
          [Time] =&gt; 00:21:38
      )
  
  [004] =&gt; Array
      (
          [position] =&gt; 0
          [Date] =&gt; 28.04.2013
          [Time] =&gt; 00:26:09
      )
  
  [003] =&gt; Array
      (
          [position] =&gt; 0
          [Date] =&gt; 28.04.2013
          [Time] =&gt; 00:15:06
      )
  </code></pre>
  
  <p>)</p>
  
  <p>I've tried a few functions but none of the worked right. Either the arrays with position = 1 are the last ones or all arrays just sort by date and time. I can`t figure it out by myself.
  Thanks in advance and sorry if my English is bad.</p>