title: Remove duplicates in a php loop - only addup values from unique ID #
body: <p>Ive seen many posts explaining to use <code>array_unique</code> but i dont think that will work with my scenario...</p>
  
  <p>I have multiple results in this report, if you notice from my picture the ST/OT has duplicate <code>1.50</code> and <code>2.00</code> values because each sql entry has <code>1.50</code> and <code>2.00</code> for each st_ot cell</p>
  
  <p>At the bottom where it totals up, obviously now from <code>$stot_total += $data["stot"];</code>. It is adding up the total. But what I really want is the total of <code>1.50 + 2.00 (3.50)</code>. I dont want it to add the duplicates.</p>
  
  <p>All the ones that are <code>1.50</code> have the same <code>ID#</code> as well, so if theres a way to only add values from <code>ID#1</code>, then <code>ID#2</code>, then <code>ID#3</code> and so on... that would work for me...</p>
  
  <p>i apologize for this horrible post... this question is regarding the ST/OT values only ** </p>
  
  <pre><code>foreach($dary as $data){
  $stot_total += $data["stot"];
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/KGYuG.png" alt="enter image description here"></p>