title: How to sum values from associative array if there is the same key in php laravel
body: <p>Simple code like this:</p>
  <pre><code>        $array = [
              [11 =&gt; 771725],
              [11 =&gt; 847226],
              [10 =&gt; 410035],
              [11 =&gt; 455387],
          ];
          dd($array);
  </code></pre>
  <p>output:</p>
  <p><a href="https://i.stack.imgur.com/1n1ec.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1n1ec.png" alt="enter image description here" /></a></p>
  <p>The result in OCTOBER (10) there is 1 price:</p>
  <pre><code>[&quot;410035&quot;]
  </code></pre>
  <p>while in NOVEMBER (11) there are 3 prices:</p>
  <pre><code>[&quot;771725&quot;, &quot;847226&quot;, &quot;455387&quot;]
  </code></pre>
  <p>and at DECEMBER (12) is none</p>
  <p>I need logic to calculate all prices in months 10, 11, and 12.
  The expected output is</p>
  <pre><code>[
      10 =&gt; &quot;2074338&quot;,
      11 =&gt; &quot;410035&quot;,
      12 =&gt; &quot;0&quot;
  ]
  </code></pre>
  <p>Thanks :)</p>