← All built-ins / isset()

isset()

isset(...$args): bool

Parameters

NameTypeDescription
$varmixedvariable or array element

Return value

true when the variable is set and not null.

Example

$m = ["k" => 1];
var_dump(isset($m["k"]));
var_dump(isset($m["missing"]));
bool(true)
bool(false)

See also

unset()array_key_exists()