title: show difference between of two price list
body: <p>I have history list of product price(order by created_at) like this:</p>
  <pre><code>Array
  (
      [0] =&gt; stdClass Object
          (
              [id] =&gt; 1
              [product_id] =&gt; 49
              [price] =&gt; 14520000.0000
              [created_at] =&gt; 1592501154
          )
  
      [1] =&gt; stdClass Object
          (
              [id] =&gt; 2
              [product_id] =&gt; 49
              [price] =&gt; 14000000.0000
              [created_at] =&gt; 1592587554
          )
  
      [2] =&gt; stdClass Object
          (
              [id] =&gt; 4
              [product_id] =&gt; 49
              [price] =&gt; 14800000.0000
              [created_at] =&gt; 1592673954
          )
  
      [3] =&gt; stdClass Object
          (
              [id] =&gt; 5
              [product_id] =&gt; 49
              [price] =&gt; 10000000.0000
              [created_at] =&gt; 1592760354
          )
  
      [4] =&gt; stdClass Object
          (
              [id] =&gt; 6
              [product_id] =&gt; 49
              [price] =&gt; 14000000.0000
              [created_at] =&gt; 1592846754
          )
  
      [5] =&gt; stdClass Object
          (
              [id] =&gt; 7
              [product_id] =&gt; 49
              [price] =&gt; 14000000.0000
              [created_at] =&gt; 1592933154
          )
  
      [6] =&gt; stdClass Object
          (
              [id] =&gt; 8
              [product_id] =&gt; 49
              [price] =&gt; 14000000.0000
              [created_at] =&gt; 1593019554
          )
  
  )
  </code></pre>
  <p>Now for show data in table I listed price using <code>foreach</code> method like this:</p>
  <pre><code>   &lt;?php foreach($product_prices_list as $product_price_list):?&gt;
       &lt;tr&gt;
           &lt;td&gt;&lt;?= esc($product_price_list-&gt;created_at);?&gt;&lt;/td&gt;
           &lt;td class=&quot;text-center&quot;&gt;&lt;?= esc(number_format($product_price_list-&gt;price));?&gt;&lt;/td&gt;
           &lt;td class=&quot;text-center&quot;&gt;&lt;/td&gt; //show difference between of two price
       &lt;/tr&gt;
     &lt;?php endforeach;?&gt;
  </code></pre>
  <p>I can see true output in table but I need to show difference between of two price  in the third column like this picture:</p>
  <p><a href="https://i.stack.imgur.com/4dn8o.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4dn8o.png" alt="enter image description here" /></a></p>
  <p>how do can i show difference between of two price in my list?!</p>