"22", 3=>"33", 4=>"" ); print_r(count(array_fil">
当前位置:Gxlcms > PHP教程 > php中计算数组不为空的方法

php中计算数组不为空的方法

时间:2021-07-01 10:21:17 帮助过:22人阅读

本文为大家介绍下php计算数组不为空元素个数的方法,需要的朋友可以参考下

代码如下:

<?php 
$arr = array( 
1=>"11", 
2=>"22", 
3=>"33", 
4=>"" 
); 
print_r(count(array_filter($arr))); 
?

以上就是php中计算数组不为空的方法的详细内容,更多请关注Gxl网其它相关文章!

人气教程排行