KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
PHP has an intval() 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 is_int() , but that returns false for string like "2" . PHP has the is_numeric() 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.: my_is_int("2") == TRUE my_is_int("2.1") == FALSE
Tags (comma-separated)
Save Edits
Cancel