September 2001
Intermediate to advanced
768 pages
32h 45m
English
bool is_long(mixed value) Tests whether a value is an integer.
Returns:
TRUE if the value is an integer; FALSE otherwise
Description:
is_long() checks whether value is an integer. If so, the function returns TRUE. If not, FALSE is returned.
Availability:
UNIX, Windows
Version:
3+, 4+
See also:
gettype()
Example:
$value = 29.5 + 0.5; // Note that even though $value contains 30 it is still not an integer. // This is because the value of 30 was created by adding two doubles // ...making the resulting value a double as well if (is_long ($value)) print 'Value $value is an integer.'; else print 'Value $value is not an integer.'; $value = 30; // Now $value contains an integer if (is_long ($value)) print ... |
Read now
Unlock full access