title: Wrong output after calculate PHP
body: <p>I'm having a bit of a problem with calculating in PHP. The output echo has a wrong value. For example the echo with 3500, should be 475. Instead I get an 525? Where I am going  wrong?</p>
  
  <p>I'm trying to create a system to calculate a service fee. The fee will be automaticly generated by sum. For the first part of 2500 euros, the service fee will be 15%. For the second part (part between 2500 and 5000) the fee will be 10% etc. I've wrote the following code, but my output (echo) is incorrect. Without the <code>exit;</code> it just keeps looping. Whats wrong in my code? Does anyone have a suggestion. I'm a PHP newbee BTW, so any help would be appreciated!</p>
  
  <pre><code>&lt;?
  
  ### Sum ###
  $som = 3500; // example sum 3500 (2500 first part 15% / 1000 second part 10%)
  
  /* Output should be with 3500 : 
  15% of 2500 = 375 + 10% of 1000 = 100 (part above 2500) TOTAL of 475. 
  My output is 525??? :s */
  
  
  ### 15% first 2500 ###
  if ($som &lt; 2500); {
  $uitkomst = $som / 100 * 15; 
  echo $uitkomst;
  exit; }
  
  ### 10% between 2500 - 5000 ###
  if ($som &gt;2500 &amp;&amp; $som &lt; 5000); {   
  $iv1 = 2500 / 100 * 15;
  $ts = $som - 2500;
  $iv2 = $ts / 100 * 10;
  $iv1 + $iv2 = $uitkomst; 
  echo $uitkomst;
  exit; }
  
  ### 5% between 5000 - 10.000 ###
  if ($som &gt;5000 &amp;&amp; $som &lt;10000); {   
  $iv1 = 2500 / 100 * 15;
  $iv2 = 2500 / 100 * 10;
  $ts = $som - 5000;
  $iv3 = $ts / 100 * 5;
  $iv1 + $iv2 + $iv3 = $uitkomst; 
  echo $uitkomst; 
  exit; }
  
  ### 1% between 10.000 and 200.000 ###
  if ($som &gt;10000 &amp;&amp; $som &lt;200000); { 
  $iv1 = 2500 / 100 * 15;
  $iv2 = 2500 / 100 * 10;
  $iv3 = 5000 / 100 * 5;
  $ts = $som - 10000;
  $iv4 = $ts / 100 * 1;
  $iv1 + $iv2 + $iv3 + $iv4 = $uitkomst; 
  echo $uitkomst;
  exit; }
  
  ### 0.5% over 200.000 ###
  if ($som &gt;200000); {    
  $iv1 = 2500 / 100 * 15;
  $iv2 = 2500 / 100 * 10;
  $iv3 = 5000 / 100 * 5;
  $iv4 = 190000 / 100 * 1;
  $ts = $som - 200000;
  $iv5 = $ts / 100 * 0.5;
  $iv1 + $iv2 + $iv3 + $iv4 + $iv5 = $uitkomst; 
  echo $uitkomst;
  exit; }
  ?&gt;
  </code></pre>