Is there a difference between isset
and !empty
. If I do this double boolean check, is it correct this way or redundant? and is there a shorter way
"Empty": only works on variables. Empty can mean different things for different variable types (check manual: http://php.net/manual/en/function.empty.php).
"isset": checks if the variable exists and checks for a true NULL or false value. Can be unset by calling "unset". Once again, check the manual.
Use of either one depends of the variable type you are using.
I would say, it's safer to check for both, because you are checking first of all if the variable exists, and if it isn't really NULL or empty.