September 2001
Intermediate to advanced
768 pages
32h 45m
English
bool is_null(mixed value) Tests whether a value is NULL .
Returns:
TRUE if the value is NULL; FALSE otherwise
Description:
is_null() returns TRUE if value is NULL. If not, FALSE is returned.
Availability:
UNIX, Windows
Version:
4.0.4+
See also:
gettype()
Examples:
// Define a variable to use in testing
$test = TRUE;
is_null ($test)
or die ('Variable $test is not NULL');
|
<pre> <?php // Make a list of values to test $values = array ( 'empty string ("")' => '', 'Zero (0)' => 0, 'TRUE' => TRUE, "'Hello'" => 'Hello', 'empty array' => array(), 'NULL' => NULL ); // Loop through the values and test whether they are objects foreach ($values as $key => $value) ... |
Read now
Unlock full access