isset
Determines if a variable is declared and is different than null.
Parameters
main.php
Return Values
bool
Returns true if var exists and has any value other than null
On success:true if variable is set and not null
On failure:false if variable is unset or null
Notes
- This is a language construct, not a function
- Returns false for variables assigned to null
- Can check multiple variables - returns true only if ALL are set
- Evaluation stops at first unset variable (short-circuit evaluation)
Changelog
- Function has been available since PHP 4.0.0
Related Functions
is_array
VariableChecks whether a variable is an array.
validationtype-checksafety
empty
VariableDetermines whether a variable is empty. A variable is considered empty if it does not exist or if its value equals false.
validationcheckinput
strlen
StringReturns the length of a string in bytes.
lengthvalidationsecurity
preg_match
RegExPerforms a regular expression match against a string and returns whether a match was found.
regexpatternvalidation