"22",3=>"33",4=>"");print_r(count(array_filter($arr)));?> php计算数组不为空元素个数的方法 更新日期:2026/7/31" />

站长资源网络编程

php计算数组不为空元素个数的方法

整理:jimmy2026/7/31浏览2
简介复制代码 代码如下: "11", 2=>"22", 3=>"33", 4=>"" ); print_r(count(array_filter($arr))); ?>
复制代码 代码如下:
<?php
$arr = array(
1=>"11",
2=>"22",
3=>"33",
4=>""
);
print_r(count(array_filter($arr)));
?>