title: php multidimensional array sort
body: <p><strong>I have this multidimensional array</strong>
  I am wondered how can i sort this array again so i can use it in for loop.</p>
  
  <pre><code>array (size=3)
    0 =&gt; 
      array (size=1)
        0 =&gt; 
          array (size=7)
            'username' =&gt; string 'wajdi' (length=5)
            'userimage' =&gt; string 'file_3898.jpg' (length=13)
            'date' =&gt; int 1373721708
            'postid' =&gt; string '118' (length=3)
            'type' =&gt; string 'comment' (length=7)
            'comment' =&gt; string 'a' (length=1)
            'notify' =&gt; string '0' (length=1)
    2 =&gt; 
      array (size=1)
        2 =&gt; 
          array (size=7)
            'username' =&gt; string 'wajdi' (length=5)
            'userimage' =&gt; string 'file_3898.jpg' (length=13)
            'date' =&gt; int 1373721711
            'postid' =&gt; string '118' (length=3)
            'type' =&gt; string 'comment' (length=7)
            'comment' =&gt; string 'c' (length=1)
            'notify' =&gt; string '0' (length=1)
    3 =&gt; 
      array (size=1)
        3 =&gt; 
          array (size=7)
            'username' =&gt; string 'wajdi' (length=5)
            'userimage' =&gt; string 'file_3898.jpg' (length=13)
            'date' =&gt; int 1373721712
            'postid' =&gt; string '118' (length=3)
            'type' =&gt; string 'comment' (length=7)
            'comment' =&gt; string 'd' (length=1)
            'notify' =&gt; string '0' (length=1)
  </code></pre>
  
  <p>How can I reindex this array to become</p>
  
  <pre><code>array (size=3)
    0 =&gt; 
      array (size=1)
        0 =&gt; 
          array (size=7)
            'username' =&gt; string 'wajdi' (length=5)
            'userimage' =&gt; string 'file_3898.jpg' (length=13)
            'date' =&gt; int 1373721708
            'postid' =&gt; string '118' (length=3)
            'type' =&gt; string 'comment' (length=7)
            'comment' =&gt; string 'a' (length=1)
            'notify' =&gt; string '0' (length=1)
    1 =&gt; 
      array (size=1)
        1 =&gt; 
          array (size=7)
            'username' =&gt; string 'wajdi' (length=5)
            'userimage' =&gt; string 'file_3898.jpg' (length=13)
            'date' =&gt; int 1373721711
            'postid' =&gt; string '118' (length=3)
            'type' =&gt; string 'comment' (length=7)
            'comment' =&gt; string 'c' (length=1)
            'notify' =&gt; string '0' (length=1)
    2 =&gt; 
      array (size=1)
        2 =&gt; 
          array (size=7)
            'username' =&gt; string 'wajdi' (length=5)
            'userimage' =&gt; string 'file_3898.jpg' (length=13)
            'date' =&gt; int 1373721712
            'postid' =&gt; string '118' (length=3)
            'type' =&gt; string 'comment' (length=7)
            'comment' =&gt; string 'd' (length=1)
            'notify' =&gt; string '0' (length=1)
  </code></pre>
  
  <p><strong>I tried array_shift and array_chunk but nothing works !!!
  Please help, thank you all :)</strong></p>