php 过滤多维数组中值为空的字段
作者:互联网
function filter_array($arr, $values = ['',[]]){ foreach ($arr as $k => $v) { if (is_array($v) && count($v)>0) { $arr[$k] = filter_array($v, $values); } foreach ($values as $value) { if ($v === $value) { unset($arr[$k]); break; } } } return $arr; }
标签:arr,value,filter,values,foreach,多维,中值,array,php 来源: https://www.cnblogs.com/qxandxt/p/15654935.html