Home > php教程 > php手册 > php中经典方法实现判断多维数组是否为空

php中经典方法实现判断多维数组是否为空

WBOY
Release: 2016-06-13 12:05:27
Original
1154 people have browsed it

复制代码 代码如下:


//判断一个数组是否为空
/**
array(
); 空
array(
array(
),
array(
),
array(
)
); 空
array(
array(
),
array(
array(
),
array(
1=>1
)
),
array(
)
); 非 空
*/
function is_array_null($value)
{
if (empty($value))
{
return $value;
}
else
{
return is_array($value) ? array_map('array_null', $value) : addslashes($value);
}
}

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template