PHP Dokumentation: Function is-null
12. Januar 2010 von werner
is_null
(PHP 4 >= 4.0.4, PHP 5)
is_null — Prüft ob eine Variable NULL enthält
Parameter-Liste
- var
Die zu prüfende Variable.
Rückgabewerte
Liefert TRUE wenn var null enthält, sonst FALSE.
Beispiele
Beispiel #1 is_null()-Beispiel
<?phperror_reporting
(E_ALL);$foo = NULL;
var_dump(is_null($inexistent), is_null($foo));?>Notice: Undefined variable: inexistent in ...bool(true)bool(true)
Siehe auch
- Der NULL-Typ
- isset() – Prüft, ob eine Variable existiert und ob sie nicht NULL ist
- is_bool() – Prüft, ob eine Variable vom Typ boolean ist
- is_numeric() – Prüft, ob eine Variable eine Zahl oder ein numerischer String ist
- is_float() – Prüft, ob eine Variable vom Typ float ist
- is_int() – Prüft, ob eine Variable vom Typ int ist
- is_string() – Prüft, ob Variable vom Typ string ist
- is_object() – Prüft, ob eine Variable vom Typ object ist
- is_array() – Prüft, ob die Variable ein Array ist