Today I've created a function called is_empty()
. The function is similar to already existing empty()
function - it adds a few more checks that are required by my script.
However, now when I run the script and some value is not set, I get the: Notice: Undefined index
notice. The default empty()
function display this notice and it assumes the value is empty, is there some way to configure my function to do the same? Instead of using isset()
together with is_empty()
?
Thank you very much!
EDIT: My function is here:
function is_empty($value, $integer = FALSE){
if($integer){
return empty($value) && !is_numeric($value);
}
return empty($value);
}