I want a 0 to be considered as an integer and a \'0\' to be considered as a string but empty() considers the \'0\' as a string in the example below,
$var = \
You can not, because integer,string,float,null does not matter for PHP.
Because it is cool :)
You must check characteristic features your variable is_numeric,isset,===,strlen, etc.
For example:
if (strlen(@$var)==0) {
echo @$var . ' is empty';
}
or
if (@$var==="" || !isset($var)) {
echo @$var . ' is empty';
}
or other examples :)
thanks for reading.