PHP is_null() Functie
❮ Referentie voor het afhandelen van PHP-variabelen
Voorbeeld
Controleer of een variabele NULL is of niet:
<?php
$a = 0;
echo "a is " . is_null($a) . "<br>";
$b = null;
echo "b
is " . is_null($b) . "<br>";
$c = "null";
echo "c is " . is_null($c)
. "<br>";
$d = NULL;
echo "d is " . is_null($d) . "<br>";
?>
Definitie en gebruik
De functie is_null() controleert of een variabele NULL is of niet.
Deze functie retourneert true (1) als de variabele NULL is, anders wordt false/niets geretourneerd.
Syntaxis
is_null(variable);
Parameterwaarden
Parameter | Description |
---|---|
variable | Required. Specifies the variable to check |
Technische details
Winstwaarde: | TRUE als variabele NULL is, anders FALSE |
---|---|
Retourtype: | Booleaans |
PHP-versie: | 4.0.4+ |
❮ Referentie voor het afhandelen van PHP-variabelen