RSS Template Variables
Design and Skin Customization
You use a foreach loop to loop over the elements in an array, so if you have an array like this:
$the_array = array('cat', 'dog', 'ant eater');then a foreach loop over it would go
{foreach $_the_array as $animal}
The animal is a {$animal}
{/foreach}
But if your array looks like this
$the_array = array('tom' => 'cat', 'bill' => 'dog', 'simon' => 'ant eater');Then the foreach loop would look like this
{foreach $_the_array as $owner => $pet}
The pet of {$owner} is a {$pet}
{/foreach}
So it depends on what your array looks like as to how you access it outside a loop.
For the second array you can go
the pet of Simon is a {$the_array['simon']}or
the pet of Simon is a {$the_array.simon}
to get Simons pet.
updated by @michael: 08/22/19 10:16:57PM