You are here: Re: [SMARTY] foreach in reverse « Smarty Templates Posts « IT news, forums, messages
Re: [SMARTY] foreach in reverse

Posted by boots on 08/11/05 23:59

--- Matt Warden <mwarden@gmail.com> wrote:
> smarties,
>
> I was hoping that there was a way to do a foreach in reverse (i.e.,
> starting with the last element and ending with the first). After
> seeing that there doesn't seem to be, I tried to work out the
> equivalent of a 'foreach in reverse' with sections and a negative
> step. Does someone have an example of doing this?

Hi.

I assume that this would work:

{foreach from=$myarray|@array_reverse:true item=foo} ...

See:

- http://smarty.php.net/manual/en/language.modifiers.php
- http://php.net/array_reverse

HTH

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация