0

The following statements:

echo "<pre>";
print_r($result);
echo "</pre>";

Yield the result:

stdClass Object
(
    [tickets] => Array
    (
        [0] => stdClass Object
            (
            ['SomeData']
            )
        [1] => stdClass Object
            (
            ['SomeData']
            )
        [2]
            ...
    )
)

I'd like to count the total entires inside[tickets].

I have tried:

print_r(array_count_values())

and:

$totalResults = 0;
foreach ($result as $value) {
    $totalResults++;
}
//echo $totalResults;

The former yields Warning: array_count_values() expects parameter 1 to be array, object given in...

* edit *

The following:

$total = count((array)$result);
echo $total;

Yields the value 4 when I know the output should be well over 100.

2
  • I will try that immediately and report so this question can be deleted. Commented May 13, 2018 at 23:44
  • 1
    Why not count($result->tickets);? Commented May 14, 2018 at 0:05

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.