i have a function to filter unwanted values in array (usually false and empty values) here it is :
function filter_array($arr , $filter = array('' , FALSE)){
foreach($arr as $k=>$v)
{
if(in_array(trim($v) , $filter))
unset($arr[$k]);
}
return $arr;
}
here is the problem , it considering 0 as false and removing them from array ... how can i fix this ?
one way is to loop trough $filter and and use === to check the values but i want to avoid another loop