title: Sum values of the array against same SKU
body: <p>I am getting the total sold items from an URL and it return in an array that contains the 'SKU', 'Date', 'Quantity' and 'Total Price'. 
      I want to calculate the Total Quantity against Same 'SKU' and store in new array. 
      Can any one let me know how can i do this in PHP language? </p>
  
  <pre><code>$url ="abc";                
  &lt;pre&gt;
  $post_fields = array();                     
  $post_fields['EndDateUtc']=$end;
  $post_fields['StartDateUtc']=$start;
  $post_fields['TenantToken']=$TenantToken;
  $post_fields['UserToken']= $UserToken;          
  $data_string = json_encode($post_fields);               
  &lt;/pre&gt;
  &lt;pre&gt;
  $curl_header = array();
  $curl_header[] = 'Content-type: application/json';
  $ch = curl_init($url);
  curl_setopt($ch, CURLOPT_POST, 1);
  curl_setopt($ch, CURLOPT_HTTPHEADER, $curl_header);
  curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 180);
  curl_setopt($ch, CURLOPT_TIMEOUT, 180);
  $output = curl_exec($ch);
  curl_close($ch);
  $datr = json_decode($output, TRUE); 
  print_r($datr);
  </code></pre>
  
  <p>
      Array Output :
      --------------
      <pre></p>
  
  <code>Array
  (
      [SoldItems] =&gt; Array
          (
              [0] =&gt; Array
                  (
                      [SKU] =&gt; 8273-Navy-M
                      [Date] =&gt; 2017-10-12
                      [Quantity] =&gt; 15
                      [TotalPrice] =&gt; 7685
                  )
  
              [1] =&gt; Array
                  (
                      [SKU] =&gt; 2879-S-B-White-3XL
                      [Date] =&gt; 2017-10-12
                      [Quantity] =&gt; 2
                      [TotalPrice] =&gt; 298
                  )
  
              [2] =&gt; Array
                  (
                      [SKU] =&gt; 8273-Navy-M
                      [Date] =&gt; 2017-10-12
                      [Quantity] =&gt; 2
                      [TotalPrice] =&gt; 298
                  )
  
              [3] =&gt; Array
                  (
                      [SKU] =&gt; 2262-S-A-Black-2XL
                      [Date] =&gt; 2017-10-12
                      [Quantity] =&gt; 1
                      [TotalPrice] =&gt; 199
                  )
          )
  )
  
  &lt;/pre&gt;
  
  thank you so much.
  </code></pre>