If you're wanting to see if a variable contains a value, you can use [man]empty[/man]. If you want to specifically check that it's non-null, (as opposed to non-0 or non-""), then you can use the type-safe comparison operators === and !==. These don't do any typecasting, so if the argument on the left of a === comparison is (say) an integer, and the argument on the right is a string, then the result is false, even if the integer is 0 and the string is "0".
Even though 0==null and "0"==0, "0"!=null, because PHP's typecasting rules would turn those comparisons into, respectively, 0==0, "0"=="0", and "0"!=""
echo (0=="0")?'0=="0"':'0!="0"';
echo '<br>';
echo (0=="")?'0==""':'0!=""';
echo '<br>';
echo ("0"=="")?'"0"==""':'"0"!=""';
echo '<br>';
echo (0==$oink)?'0==$oink':'0!=$oink';
echo '<br>';
echo (0==null)?'0==null':'0!=null';
echo '<br>';
echo (0===null)?'0===null':'0!==null';
echo '<br>';
echo ($oink===null)?'$oink===null':'$oink!==null';
echo '<br>';
echo (0==="0")?'0==="0"':'0!=="0"';
echo '<br>';
echo ("0"==null)?'"0"==null':'"0"!=null';
echo '<br>';
echo ("0"===null)?'"0"===null':'"0"!==null';
echo '<br>';
0=="0"
0==""
"0"!=""
Notice: Undefined variable: oink in test.php on line 8
0==$oink
0==null
0!==null
Notice: Undefined variable: oink in test.php on line 14
$oink===null
0!=="0"
"0"!=null
"0"!==null