For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > December 2004 > Re: [SMARTY] Count of array indexes









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [SMARTY] Count of array indexes
Boots

2004-12-08, 3:59 pm

--- Rainer Müller <mueller_rainer@gmx.de> wrote:
> Hi,
>
> is there a way to output the number of items in an array?
> I tried {$foo|count} but that did not work.


Take a close look at
http://smarty.php.net/manual/en/language.modifiers.php -- when passing
an array to a modifier, you add the @ operator like this:

{$foo|@count}

xo boots

> Rainer

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com