NOVINKA: Najžiadanejšie rekvalifikačné kurzy teraz s 50% zľavou + kurz AI ZADARMO. Nečakaj, táto ponuka dlho nevydrží! Zisti viac:

PHP - is_null

Trieda

Koreň \ Bez triedy

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ázovDátový typPredvolená hodnotaPopis
$varmixed

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";

Súvisiace manuály

      • function isset (mixed $var, mixed $...) : bool
      • function is_array (mixed $var) : bool
      • function is_bool (mixed $var) : bool
      • function is_float (mixed $var) : bool
      • function is_int (mixed $var) : bool
      • function is_numeric (mixed $var) : bool
      • function is_string (mixed $var) : bool
      Aktivity