title: How to check that a string is an int, but not a double, etc.?
body: <p>PHP has an <code>intval()</code> function that will convert a string to an integer. However I want to check that the string is an integer beforehand, so that I can give a helpful error message to the user if it's wrong. PHP has <code>is_int()</code>, but that returns false for string like <code>"2"</code>.</p>
  
  <p>PHP has the <code>is_numeric()</code> function, but that will return true if the number is a double. I want something that will return false for a double, but true for an int.</p>
  
  <p>e.g.:</p>
  
  <pre><code>my_is_int("2") == TRUE
  my_is_int("2.1") == FALSE
  </code></pre>