title: how to group values inside an array in php?
body: <p>i have this situation <code>$result</code>:</p>
  
  <pre><code>[result] =&gt; Array
      (
          [Jeffrey] =&gt; Array
              (
                  [date] =&gt; Array
                      (
                          [0] =&gt; 1294439732
                          [1] =&gt; 1294074456
                          [2] =&gt; 1295041663
                      )
                  [amt] =&gt; Array
                      (
                          [0] =&gt; 6.90
                          [1] =&gt; 19.50
                          [2] =&gt; 19.50
                      )
              )
          [John] =&gt; Array
              (
                  [date] =&gt; Array
                      (
                          [0] =&gt; 1294439732
                          [1] =&gt; 1294074456
                          [2] =&gt; 1295041663
                      )
                  [amt] =&gt; Array
                      (
                          [0] =&gt; 6.90
                          [1] =&gt; 19.50
                          [2] =&gt; 19.50
                      )
              )
  )
  </code></pre>
  
  <p>what i am trying to accomplish is this:</p>
  
  <pre><code>[result] =&gt; Array
      (
          [Jeffrey] =&gt; Array
              (
                  [date] =&gt; Array
                      (
                          [0] =&gt; 1294439732
                             [amt] =&gt; Array(
                               [0] =&gt; 6.90
                           )
                          [1] =&gt; 1294074456
                             [amt] =&gt; Array(
                               [0] =&gt; 19.50
                           )
                          [2] =&gt; 1295041663
                             [amt] =&gt; Array(
                               [0] =&gt; 19.50
                           )
                      )
              )
          [John] =&gt; Array
              (
                  [date] =&gt; Array
                      (
                          [0] =&gt; 1294439732
                             [amt] =&gt; Array(
                               [0] =&gt; 6.90
                           )
                          [1] =&gt; 1294074456
                             [amt] =&gt; Array(
                               [0] =&gt; 19.50
                           )
                          [2] =&gt; 1295041663
                             [amt] =&gt; Array(
                               [0] =&gt; 19.50
                           )
                      )
              )
  )
  </code></pre>
  
  <p>i might have got the array formatting wrong, but the idea is that each <code>date</code> has a corespondent <code>amt</code> and i want that amount inside the date</p>
  
  <p>not sure how to proceed to reorganize this array to look like that.
  $result['date']
  i'm thinking i need to do a foreach loop and put together <code>$result['date'] and $result['amt']</code>.</p>
  
  <p>anyone has any ideas?</p>
  
  <p>thanks</p>