• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

求用smarty中的foreach 或者 loop循环 遍历display过来的数组解决方案

php 搞代码 3年前 (2022-01-23) 27次浏览 已收录 0个评论

求用smarty中的foreach 或者 loop循环 遍历display过来的数组
$this->objS->assign(‘coolSiteLists’, $coolSiteLists);

数组print_r

Array
(
[0] => Array
(
[stpID] => 1
[stpName] => 搜索
[stpSort] => 1
[stpImg] => z_0.gif
[sites] => Array
(
[0] => Array
(
[0] => 11936
[1] => 百度
[2] => http://www.baidu.com/index.php?tn=5wcom_pg&ch=3
)

[1] => Array
(
[0] => 11937
[1] => 搜搜
[2] => http://www.soso.com/?unc=b400056&cid=union.s.wh
)

[2] => Array
(
[0] => 11938
[1] => 搜狗
[2] => http://www.sogou.com/index.php?pid=sogou-site-8725fb777f25776f
)

[3] => Array
(
[0] => 11939
[1] => 谷歌
[2] => http://www.google.com.hk/webhp?prog=aff&client=pub-9491289701756083&channel=3192690012
)

[4] => Array
(
[0] => 11940
[1] => 有道
[2] => http://www.youdao.com/
)

[5] => Array
(
[0] => 11941
[1] => 必应
[2] => http://cn.bing.com/
)

[6] => Array
(
[0] => 11942
[1] => 雅虎
[2] => http://www.yahoo.cn/
)

)

)

[1] => Array
(
[stpID] => 2
[stpName] => 购物
[stpSort] => 2
[stpImg] => z_19.gif
[sites] => Array
(
[0] => Array
(
[0] => 11943
[1] => 淘宝特卖

本文#来源gaodai.ma#com搞##代!^码7网
搞代gaodaima码

[2] => http://www.taobao.com/go/chn/tbk_channel/onsale.php?pid=mm_19869273_2351859_9092254&eventid=101586
)

[1] => Array
(
[0] => 11944
[1] => 当当网
[2] => http://p.yiqifa.com/c?s=09594d42&w=220184&c=247&i=159&l=0&e=c&t=http://www.dangdang.com
)

[2] => Array
(
[0] => 11945
[1] => 卓越网


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:求用smarty中的foreach 或者 loop循环 遍历display过来的数组解决方案

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址