Simple question?
| From: | Eric Mueller | Date: | Sun, 28 Apr 2002 06:27:02 +0000 |
| Subject: | Simple question? | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-3910@lists.php.net to get a copy of this message | ||
Ok, maybe I'm missing something, but what is the right syntax to display
this each item of $ads in Smarty?
$ads = array(
array('headline' => 'test1', 'body' => 'hello
world1', 'id' =>
'4431'),
array('headline' => 'test2', 'body' => 'hello
world2', 'id' =>
'243'),
array('headline' => 'test3', 'body' => 'hello
world3', 'id' =>
'342')
);
$smarty->assign('ads',$ads);
The PHP code that I'm trying to mimic in Smarty would go something like
this:
foreach($ads as $v) {
echo "headline is ".$v['headline'];
echo "body is ".$v['body'];
echo "id is ".$v['id'];
}
thank you,
Eric