将接口中返回数据中有null值的修改为字符串空 '';

array_walk_recursive($array, function (& $val, $key ) {
    if ($val === null) {
        $val = '';
    }    

});

猜你喜欢

转载自blog.csdn.net/ZZZZXPQ/article/details/80176151