D0000D发往论坛板块-------------------------------------------------------No0 号板块 dedecms D8888D贴子标题-------------------------------------------------------smarty循环数组问题D8888D主贴内容-------------------------------------------------------用 Smarty 的 foreach如何取出里面的值? 难道一定得用section ??? Array( [productID] => 1[productName] => 诺基亚 6220c[attribute] => Array( [品牌] => Array( [1] => name2454542177524121 )))复制代码我来回答D8888D回贴内容-------------------------------------------------------用smarty里面的foreach语句不是也可以么。
D8888D回贴内容-------------------------------------------------------用smarty里面的foreach语句不是也可以么。
Fising 发表于 2009-6-14 21:32 [url=http://www.phpchina.com/bbs/redirect.php?goto=findpost&pid=1067324&ptid=127997]链接标记[img]http://www.phpchina.com/bbs/images/common/back.gif[/img][/url]{ foreach from=$productInfo key=productInfoTitle item=productBasicInfo }产品名称:{ $productBasicInfo.productName }{ /foreach }不行....
D8888D回贴内容-------------------------------------------------------产品名称:不行....
一条尸体 发表于 2009-6-14 21:36 [url=http://bbs.phpchina.com/redirect.php?goto=findpost&pid=1067332&ptid=127997]链接标记[img]http://bbs.phpchina.com/images/common/back.gif[/img][/url]怎可能D8888D回贴内容-------------------------------------------------------我试过了呀附件: 您所在的用户组无法下载或查看附件D8888D回贴内容-------------------------------------------------------报错么D8888D回贴内容-------------------------------------------------------不报错,上面那个就是结果啊。产品名称为 1 .....
D8888D回贴内容-------------------------------------------------------我X,诡异啊D8888D回贴内容-------------------------------------------------------仔细检查一下,肯定是哪里敲错了。foreach就是专门对付这个问题的。
D8888D回贴内容-------------------------------------------------------Array ( [0] => Array ( [propertyName] => 品牌 ))你说是针对这种吧?
这种是二唯数组来的,我现在说的那种是一唯关联数组http://www.bkjia.com/PHPjc/632572.html www.bkjia.com true http://www.bkjia.com/PHPjc/632572.html TechArticle D0000D发往论坛板块------------------------------------------------------- No0 号板块 dedecms D8888D贴子标题------------------------------------------------------- smart...
