我需要计算数组值[关闭]

Can you please help me to count the array value. i am using

echo count($arrayvariable);

but its show me 1 as count.

Array
(
    [0] => Array
        (
            [0] => 13.75
            [1] => 26
            [2] => 18
            [3] => 38
        )

    [1] => Array
        (
            [0] => 8.25
            [1] => 26
            [2] => 18
            [3] => 38
        )

    [2] => Array
        (
            [0] => 1.375
            [1] => 28
            [2] => 11
            [3] => 36
        )

    [3] => Array
        (
            [0] => 0.55
            [1] => 28
            [2] => 6
            [3] => 36
        )

)

i need count of array.

First, the array in php:

$foo = Array(
    Array
        (
            8.25,
            26,
            18,
            38
        ),
    Array
        (
            1.375,
            28,
            11,
            36
        ),
    Array
        (
            0.55,
            28,
            6,
            36
        )
    );

If want to count every item you can use:

echo count($foo, COUNT_RECURSIVE); // output 15

If you want to count olny the parents:

echo count($foo); //output 3

If you want to count specific terms:

$majorThan10 = 0;

for ($i=0; $i < count($foo) ; $i++) {
    for ($j=0; $j < count($foo[$i]); $j++) { 
         if($foo[$i][$j] > 10)
            $majorThan10++;
     } 
}

echo $majorThan10; // output 8

You need to be more clear on what you want. This example shows you how to count elements in the array inside the main array and simply count of elements of array

$array = array(
  'A' => array(1,2),
  'B' => array(3,4,5)
);

$total = 0;
foreach($array as $k => $v) {
  echo "array $k count - ".count($v)."
";
  $total += count($v);
}
echo "total count of elements - $total"."
";
echo "arrays count ".count($array);

the result will be:

array A count - 2
array B count - 3
total count of elements - 5
arrays count 2