September 2001
Intermediate to advanced
768 pages
32h 45m
English
bool is_scalar(mixed value) Test whether a value is a scalar.
Returns:
TRUE if the value is a scalar; FALSE otherwise
Description:
is_scalar() tests whether a value is a scalar value. Values of types boolean, double, integer, or string are considered to be scalar values.
If the value is a scalar, the function returns TRUE. If not, FALSE is returned.
Availability:
UNIX, Windows
Version:
PHP 4.0.5+
See also:
gettype()
Example:
$value = array (1);
if (is_scalar ($value))
print "Value \$value is a scalar value.";
else
print "Value \$value is not a scalar value.";
|
Read now
Unlock full access