title: checking if a number is float in PHP
body: <p>This is really weird. I have this piece of code.</p>
  
  <pre><code>$rewardAmt = $amt;
  if(is_float($rewardAmt)){
        print_r("is float");die;
  } else {
        print_r("is not float"); die;
  }
  </code></pre>
  
  <p>value of $amt is 0.01. But it is going into else condition. So I did a var_dump of $amt. it says string(4)
  So I decided to typecast $amt </p>
  
  <pre><code>   $rewardAmt = (float)$amt;
  </code></pre>
  
  <p>But the problem with this is even if the value of $amt is 1, it still gets typecast to float and goes into if condition, which shouldn't happen. Is there any other way to do this ? Thanks</p>