It makes me feel like a right noob asking this, but is there any built-in php function that will tell you whether a variable represents an integer, or a string integer eg 2 or "2" but not 2.4 or "2.4".
is_int() will be false if it is a string.
is_numeric will allow decimal places and +- signs.
I usually just use my own function, but am I missing something built in?



Reply With Quote




Bookmarks