Loading…

Please explain the difference between isset() and empty()?

1. isset(): It returns TRUE if the variable exists and has a value other than NULL. It means variables assigned a "", 0, "0", or FALSE are set.

2. empty(): It checks to see if a variable is empty. It interpreted as: "" (an empty string).

isset($var) && !empty($var)

will be equals to !empty($var)

Suggest An Answer

No suggestions avaliable!

Latest post from PHP interview questions

Ask Question