title: Get averages of values from multidimensional array where date key's match?
body: <p>I have the following multidimensional array,</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [place] =&gt; 1
              [date] =&gt; 2013-01-01
          )
  
      [1] =&gt; Array
          (
              [place] =&gt; 2
              [date] =&gt; 2013-01-02
          )
  
      [2] =&gt; Array
          (
              [place] =&gt; 3
              [date] =&gt; 2013-01-03
          )
  
      [3] =&gt; Array
          (
              [place] =&gt; 10
              [date] =&gt; 2013-01-01
          )
  
      [4] =&gt; Array
          (
              [place] =&gt; 8
              [date] =&gt; 2013-01-02
          )
  
      [5] =&gt; Array
          (
              [place] =&gt; 5
              [date] =&gt; 2013-01-03
          )
  
  )
  </code></pre>
  
  <p>How can I get the average place each array where the dates match, so the out put array would look like? The most i've been able to do is loop over the arrays extracting the dates which is pretty easy but finding matches and getting the averages is beyond me. Thanks in advance.</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [place] =&gt; 5.5
              [date] =&gt; 2013-01-01
          )
  
      [1] =&gt; Array
          (
              [place] =&gt; 5
              [date] =&gt; 2013-01-02
          )
  
      [2] =&gt; Array
          (
              [place] =&gt; 6.5
              [date] =&gt; 2013-01-03
          )
  
  )
  </code></pre>