Reputation: 3785
With the following code I can iterate through the elements of the returned array:
foreach ($GLOBALS['myDB']->getAssets($i['uId']) as $x)
But I can't figure out how to efficiently check the size of the returned array before entering the loop.
Any ideas?
Upvotes: 1
Views: 2314
Reputation: 3793
You can use count to find out the length of an array
count($arrayName);
Upvotes: 1
Reputation: 63580
$assets = $GLOBALS['myDB']->getAssets($i['uId']);
$size = count($assets);
Upvotes: 4