User Tools

Site Tools


uphp:functions:is_int

This is an old revision of the document!


is_int

WMPRO, WMMINI FW >= 1.0 WMMEGA FW >= 2.0

Return 1 if the variable is an integer

Description

int is_int ( mixed $variable )

Return 1 (true) if the variable or value is an integer, otherwise return 0 (false)

Parameters

variable: Variable or expression to be tested to see if it is an integer

Return Value

1 if an integer, 0 if not an integer

Example

<?
$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
?>

Note

To test if a variable is a number or a numeric string (such as form input, which is always a string), you should use is_numeric().

See Also

is_float() - Return 1 if the variable is a float

is_numeric() - Return 1 if the value is numeric (integer, float or string)

is_string() - Return 1 if the variable is a string

is_array() - Return 1 if the variable is an array

uPHP Variable Types and Limits

uphp/functions/is_int.1489074588.txt.gz · Last modified: 2021/09/13 05:56 (external edit)