title: PHP Strip String, Convert to int
body: <p>I have a STRING <code>$special</code> which is formatted like <code>£130.00</code> and is also an ex TAX(VAT) price.</p>
  
  <p>I need to strip the first char so i can run some simple addition.</p>
  
  <pre><code>$str= substr($special, 1, 0);  // Strip first char '£'
  echo $str ;                    // Echo Value to check its worked
  $endPrice = (0.20*$str)+$str ; // Work out VAT
  </code></pre>
  
  <p>I don't receive any value when i echo on the second line ? Also would i then need to convert the string to an integer in order to run the addition ?</p>
  
  <p>Thanks</p>
  
  <p>Matt</p>
  
  <p>+++ UPDATE</p>
  
  <p>Thanks for your help with this, I took your code and added some of my own, There are more than likely nicer ways to do this but it works :) I found out that if the price was below 1000 would look like £130.00 if the price was a larger value it would include a break. ie £1,400.22.</p>
  
  <pre><code>$str = str_replace('£', '', $price);
  $str2 = str_replace(',', '', $str);
  $vatprice = (0.2 * $str2) + $str2;
  $display_vat_price = sprintf('%0.2f', $vatprice);
  echo "£";
  echo $display_vat_price ;
  echo " (Inc VAT)";
  </code></pre>
  
  <p>Thanks again, Matt</p>