title: How to sum the 2nd level values of a 2-dim array based on the 2nd level keys?
body: <p>I have a multi-dimensional array like this:</p>
  
  <pre><code>array(
        0 =&gt; array(
           11 =&gt; 18.000,
           14 =&gt; 25.100,
           15 =&gt; 5.000,
           16 =&gt; 8.000,
           19 =&gt; 21.600'
       ),
       1 =&gt; array(
           11 =&gt; 9.100,
           12 =&gt; 2.700,
           14 =&gt; 2.300,
           15 =&gt; 18.800,
           16 =&gt; 9.500,
           17 =&gt; 6.900,
           19 =&gt; 9.400'
      ),
      2 =&gt; array(
          14 =&gt; 5.700
      ),
      3 =&gt; array(
         17 =&gt; 2.800,
         20 =&gt; 6.000
     ),
     4 =&gt; array(
         24 =&gt; 5.000,
         25 =&gt; 6.000,
         26 =&gt; 2.7
     ),
     5 =&gt; array(
         16 =&gt; 2.200
     ),
     6 =&gt; array(
        14 =&gt; 13.000,
        15 =&gt; 2.000,
        16 =&gt; 4.300,
        19 =&gt; 6.000
    ),
    7 =&gt; array(
        32 =&gt; 5.000,
        36 =&gt; 18.500
    )
   )
  </code></pre>
  
  <p>The second-level arrays have varying length. But I want to get the values of the elements with similar keys and add them together to get a grand total.</p>
  
  <p>For example, if the array is called <code>$multi_dime</code>. I would want to get <code>$multi_dime[0][11]</code> add it to <code>$multi_dime[1][11]</code> and so on.</p>
  
  <p>If the key does not exist in a following array. It should just add <code>0</code> or ignore it. The code should proceed to do this for all keys in the second-level array and store the results in another array like:</p>
  
  <pre><code>array(  11 =&gt; 27.1,  14 =&gt; 46.1, ...)
  </code></pre>
  
  <p>How can I achieve this?  The array will always be two dimensional, but can be of any length and the second level arrays can also be any length.</p>