Can someone provide an example that make i开发者_StackOverflowt clear?
{foreach}
is used to loop over an associative array as well a numerically-indexed array,
{section}
which is for looping over numerically-indexed arrays only
The syntax for {foreach}
is much easier than {section}
, but as a tradeoff it can only be used for a single array
You may take a look at the documentation which explains the differences and provides examples.
From the manual:
the syntax for {foreach} is much easier than {section}, but as a tradeoff it can only be used for a single array.
精彩评论