A combination of isset and != is usually in order.
if you do
$a=0; # zero
if ($a)
{
echo "a is filled";
}
else
{
echo "a is not filled";
};
you will get : a is not filled.
Even though it clearly is filled.
use something like this:
if (isset($a) && ($a!=""))
{
echo "a is set and not empty";
};
A nice side-effect of checking it this way is that it doesn't generate a warning if you switch on PHP error reporting (as you really should)