PHP has the habit of evaluating (int)0 and (string)"0" as empty when using the
empty()
This didn't work for me.
if (empty($variable) && '0' != $variable) {
// Do something
}
I used instead:
if (empty($variable) && strlen($variable) == 0) {
// Do something
}