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 = \
If you want skip empty $filter and dont skip $filter = '0' and others values
$filter = ''; //or $filter = '0'; or $filter = '1'; //trim the $filter if( isset($filter) and ( $filter != '' or $filter == '0') ) { //$filter data };