abfouncutrav
New Member
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\].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.e.g.:\[code\]my_is_int("2") == TRUEmy_is_int("2.1") == FALSE\[/code\]