php - custom empty() function -
today i've created function called is_empty(). function similar existing empty() function - adds few more checks required script.
however, when run script , value not set, the: notice: undefined index notice. default empty() function display notice , assumes value empty, there way configure function same? instead of using isset() is_empty()?
thank much!
edit: function here:
function is_empty($value, $integer = false){ if($integer){ return empty($value) && !is_numeric($value); } return empty($value); }
the notice not come checks inside function. notice comes passing argument function, i.e. before function body executed. therefore, cannot change implementing function in different way.
Comments
Post a Comment