Home >Backend Development >PHP Tutorial >Usage of php isset function
isset function checks whether the variable is set. Format: bool isset ( mixed var [, mixed var [, ...]] ) Return value: If the variable does not exist, return FALSE Also returns FALSE if the variable exists and its value is NULL If the variable exists and the value is not NULL, TRUE is returned When checking multiple variables at the same time, TRUE is returned only when each single item meets the previous requirement, otherwise the result is FALSE. If a variable has been freed using unset(), it will no longer be isset(). If you use isset() to test a variable that is set to NULL, it will return FALSE. Also note that a NULL byte (" Warning: isset() can only be used with variables, as passing any other parameters will cause a parsing error. If you want to detect whether a constant has been set, use the defined() function.Example 1:
|