PHP

isset VS empty in PHP

Let’s explain the difference between isset() and empty().

isset()

Determine if a variable is set and is not NULL.

isset() function checks if a variable is set and is not NULL.
Returns TRUE if var exists, FALSE otherwise.


empty()

Determine whether a variable is empty.

empty() function checks if a variable has an empty array, empty value, empty string , 0, NULL,  false.
Returns FALSE if var has a non-empty and non-zero value.