php判断是否为空【不存在,为null,为空】

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/ufan94/article/details/81286466
    public static function checkEmpty($value) {
        if(!isset($value))
            return true ;
        if($value === null )
            return true;
        if(is_array($value) && count($value) == 0)
            return true;
        if(is_string($value) &&trim($value) === "")
            return true;

        return false;
    }
is_numeric — 检测变量是否为数字或数字字符串

猜你喜欢

转载自blog.csdn.net/ufan94/article/details/81286466
今日推荐