PHP - is_null
Trieda
Metóda - is_null
(PHP 4 >= 4.0.4, PHP 5, PHP 7)
Determines whether a given variable is null.
Procedurálne
- function is_null (mixed $var) : bool
Parametre
| Názov | Dátový typ | Predvolená hodnota | Popis |
|---|---|---|---|
| $var | mixed | The variable being checked. |
Mávratovej hodnoty
Vracia: bool
If the given variable is null, then returns true,
returns `false `otherwise.
Príklady
<?php
echo is_null(null) ? "null is null.\n" : "null is not null.\n";
echo is_null(array()) ? "array() is null.\n" : "array() is not null.\n";
echo is_null(42) ? "42 is null.\n" : "42 is not null.\n";
echo is_null("hi") ? "'hi is null.\n" : "'hi is not null.\n";
