No, empty () is not suitable for this. You must use isset ().
Why? Because many things are considered empty, which you probably do not want to miss!
The following things are considered empty:
"" (an empty string) 0 (0 as an integer) 0.0 (0 as a float) "0" (0 as a string) NULL FALSE array() (an empty array) var $var; (a variable declared, but without a value in a class)
See the manual!
markus
source share