php中 count()的一个问题
<?php$cars=array("Volvo","BMW","Toyota");echocount($cars);?>执行结果为3-------------------...
<?php
$cars=array("Volvo","BMW","Toyota");
echo count($cars);
?>
执行结果为 3
---------------------
<?php
$cars=array("Volvo","BMW","Toyota","");//增加了一个空数据
echo count($cars);
?>
执行结果为4,如何可以不统计空数据,让执行结果为3? 展开
$cars=array("Volvo","BMW","Toyota");
echo count($cars);
?>
执行结果为 3
---------------------
<?php
$cars=array("Volvo","BMW","Toyota","");//增加了一个空数据
echo count($cars);
?>
执行结果为4,如何可以不统计空数据,让执行结果为3? 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询