Re: [SMARTY] Array keys, values
Josh Trutwin <[email protected]> Mon, 15 Oct 2007 16:31:23 -0500
| Newsgroups | gmane.comp.php.smarty.general |
|---|---|
| Message-ID | <[email protected]> |
> * get the total count of the elements w/o having to iterate through
> the array
{$my_array|@count}
> * be able to access the first or last element even if the keys
> aren't numeric
Not very efficient but could do:
{foreach from=$my_array item=arr name=arr_loop}
{if $smarty.foreach.arr_loop.first}
do something for first only
{/if}
{/foreach}
Josh
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php