This is an old revision of the document!
WMPRO, WMMINI FW >= 1.0 WMMEGA FW >= 2.0
Return 1 if the variable is an integer
$variable: Variable or expression to be evaluated
1 (true) if an integer, 0 (false) if not an integer
<? $x=1; print(is_int($x)); // outputs 1, $x is an integer $y=1.0; print(is_int($y)); // outputs 0, $y is a float $z="1.0"; print(is_int($z)); // outputs 0, $z is a string ?>
This function checks ONLY the type of the variable, not the data that it holds!
To test if a variable contains a number or is a numeric string (such as form input, which is always a string), you should use is_numeric().
is_float() - Return 1 if the variable is a float
is_numeric() - Return 1 if the value is numeric (int, float or numeric string)
is_string() - Return 1 if the variable is a string
is_array() - Return 1 if the variable is an array
isset() - Return 1 if the variable exists