Our Scripts Vault contains many game scripts that you can use to create your own game!
{foreach from=$weapons key=id item=i}
<strong>{$i.name}</strong> - <em>{$i.price} gold coins</em>
foreach($weapons as $weapon){ echo "<strong>" . $weapon['name'] . "</strong> - <em>" . $weapon['price'] . "gold coins</em>"; // If it's an array echo "<strong>" . $weapon->name . "</strong> - <em>" . $weapon->price . "gold coins</em>"; // If it's an object}
Smarty compiles templates into PHP code behind the scenes, eliminating run-time parsing of templates.
{foreach from=$combat key=id item=i} <li><strong>{$i.attacker}</strong> attacks {$i.defender} for {$i.damage} damage!</li> {/foreach}
foreach ($combat as $cb) { $cb_attacker = $cb['attacker']; $cb_defender = $cb['defender']; $cb_damage = $cb['damage'];echo "<li><strong>" .$cb_attacker. "</strong> attacks " .$cb_deffender. " for " .$cb_damage. " damage!</li>"; }
Warning: Invalid argument supplied for foreach() in /home/free/ic.cz/s/snw/root/www/explore.php on line 289
echo "<li><strong>" .$cb_attacker. "</strong> attacks " .$cb_deffender. " for " .$cb_damage. " damage!</li>";
I can send you pics of my cocks if you want reference.