我想从下面的数组中获取计数
CASE 1
Array ( [0] => [1] => [2] => [3] => [4] => [5] => )
CASE 2
Array ( [0] => name [1] => telephone [2] => [3] => [4] => [5] => )
If I use COUNT, results is 5
echo count($array);
我想得0(案例1)和2(案例2)
有办法做到这一点吗?
答案 0 :(得分:1)
使用此:
$remove_empty = array_filter($your_array);
print_r($remove_empty);