Name

isset()

Synopsis

    bool isset ( mixed var [, mixed var [, ...]] )

The isset() function returns true if its parameter has already been set in your script. This is not the same as the empty(): if a variable was set and had no value, isset() would return true, and empty() would return false.

To check for "variable not set," use the not operator !, as in if (!isset($foo)).

Get PHP in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.