-1

Hello everyone i want to count total number of record in array.I tried with following code but not worked. i want "2" as result for current array. Here is my code and current array value showing.

print_r(array_count_values($participants));

Array
(
    [0] => abc
        (
            [version:protected] => Twilio\Rest\Api\V2010 Object
                (
                )
        )
    [1] => abc
        (
            [version:protected] => Twilio\Rest\Api\V2010 Object
                (
                )
        )
)

2 Answers2

0
echo sizeof($participants);

or

echo count($participants);
Dieter Kräutl
  • 657
  • 4
  • 8
0
$participants = Array
(
    [0] => abc
        (
            [version:protected] => Twilio\Rest\Api\V2010 Object
                (
                )
        )
    [1] => abc
        (
            [version:protected] => Twilio\Rest\Api\V2010 Object
                (
                )
        )
)

print_r(count($participants));
Rafeeq Mohamed
  • 182
  • 1
  • 4
  • 14