How do I echo the number of items in an array?
- by Joel
A total newbie question I know.
I'm sing Zend framework, and sending an array from the controller:
$this->view->googleArray = $viewFeedArray;
In the view, I have a foreach loop that is populating a table with the array contents.
<?php
foreach($this->googleArray as $row) { ?>
<tr>
<td><?php echo $row['when']; ?></td>
...
...
</tr>
<?php
}
?>
It all works fine. At the top of the table, I want to list the number of items in the array.
Something like (which doesn't work):
<?php echo $this->googleArray->totalResults; ?> event(s) found
How would I do that?
Thanks!