check variable empty code example
Example 1: bash if null or empty
if [ -z "$variable" ];
then echo "$variable is null";
else echo "$variable is not null";
fi
Example 2: php code to check if variable is null
if(empty($var1)){
echo 'This line is printed, because the $var1 is empty.';
}