Re: [SMARTY] foreach in reverse
boots <[email protected]>
| Newsgroups | gmane.comp.php.smarty.general |
|---|---|
| Message-ID | <[email protected]> |
--- Matt Warden <[email protected]> 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 -- Smarty General Mailing List (http://smarty.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php