title: php Sum specific value from multidimensional array
body: <p>I have array like this : </p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [impr] =&gt; 800000
              [clicks] =&gt; 500
              [ctr] =&gt; 0.000625
              [cvr] =&gt; 0.04
              [cpc] =&gt; 0.14024
              [cpm] =&gt; 0.08765
              [cpa] =&gt; 3.51
          )
  
      [1] =&gt; Array
          (
              [impr] =&gt; 889000
              [clicks] =&gt; 600
              [ctr] =&gt; 0.000625
              [cvr] =&gt; 0.08
              [cpc] =&gt; 0.34024
              [cpm] =&gt; 0.08765
              [cpa] =&gt; 4.41
          )
  
  )
  </code></pre>
  
  <p>I want to sum that array and get result like this</p>
  
  <pre><code>Array
  (
     [impr] =&gt; 1689000
     [clicks] =&gt; 1100
     [ctr] =&gt; 0.0025
     [cvr] =&gt; 0.12
     [cpc] =&gt; 0.96096
     [cpm] =&gt; 0.1753
     [cpa] =&gt; 7.92
  )
  </code></pre>
  
  <p>I trying to using </p>
  
  <blockquote>
    <p>array_sum()</p>
  </blockquote>
  
  <p>with looping my array to that array_sum, but I getting error like this</p>
  
  <p>array_sum() expects parameter 1 to be array, integer given</p>
  
  <p>And even try looping with foreach and using += for sum the value, but the result is not I want </p>
  
  <p>the result is 800000889000</p>
  
  <p>Can anyone suggest me the better code for getting my result like I want</p>