title: PHP - test if a variable is an integer while allowing ".0" decimals
body: <p>I want to check if number is numeric. <code>ctype_digit()</code> is a good function but I want <code>2.0</code> to return true and <code>2.1</code> to return false.</p>
  
  <pre><code>var_dump(ctype_digit(1)); // true
  
  var_dump(ctype_digit(1.0)); // false - I want true
  
  var_dump(ctype_digit(1.1)); // false
  </code></pre>