views:

55

answers:

1

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!

+8  A: 

Tried this?

<?php echo count($this->googleArray); ?> event(s) found
Cetra
sweet! Worked great! I've been working on this for over an hour. Thanks!
Joel
@Joel: Don't forget to boost your 88% accept rate by accepting @Cetra's answer.
Johnsyweb
yes-I am counting down the minutes till I can accept the answer...
Joel
@Joel: Here is a list of available array functions: http://php.net/manual/en/ref.array.php Can come handy. You should always read the documentation.
Felix Kling