creates a foreach loop, needs an {end:} tag. note that the engine will add the variable to the scope, so they will not be prefixed with $t-> when used inside the loop.
Parameter
string variable - relates to $object->variable
string key - creates a variable 'key' in the current scope.
string value - optionally creates a variable 'value' in the current scope. (as in $key=>$value)
<?php if (is_array($t->a)) foreach($t->a as $k => $v) { ?> k is <?php echo htmlspecialchars($k); ?>, and v is <?php echo htmlspecialchars($v); ?> <?php } ?> <?php if (is_array($t->a)) foreach($t->b as $v) { ?> v is <?php echo htmlspecialchars($v); ?> <?php } ?>
Deliver First Class Web Sites: 101 Essential Checklists Want to learn how to make your web sites usable and accessible? Want to ensure that your sites meet current best practice, without spending hours trawling through incomprehensible specifications and recommendations from dozens of different books, research papers, and web sites? Want to make sure that the sites you build are "right the first time," requiring no costly redevelopments?