如何計算陣列元素的數量數目count(array) php

[php] count — 計算陣列中的單元數目或對象中的屬性個數

$a[0] = 1;
$a[1] = 3;
$a[2] = 5;
$result = count($a);
// $result == 3

$b[0] = 7;
$b[5] = 9;
$b[10] = 11;
$result = count($b);
// $result == 3;