Skip to content

empty ​

php
bool empty(mixed $zmienna)

Checks whether the supplied argument is empty. Returns true if $zmienna is undefined or has one of these values: "" (empty string), 0 (as a number or the string "0"), null, false, or array() (empty array).

Example:

php
$imie = get_val("prop1");
if (empty($imie)) {
print("Dear stranger");
} else {
$imie_wolacz = pl_imiewolacz($imie);
print("Dear ".$imie_wolacz);
}

Result:

Dear Arturze