/ Published in: PHP

PHP has is_numeric, and is_int, but this is a not a complete set. Is_numeric doesn't maintain that the value is strictly an integer, and is_int returns true if the TYPE of the variable is an integer. This returns whether a variable holds an integer value as either a true int, or as a string.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** * Check if a number is a counting number by checking if it * is an integer primitive type, or if the string represents * an integer as a string */ function is_int_val($data) { } return false; }
Comments
