字段有多个图片输出方法

1.控制器操作:

如果数据可读出来的数据dump是Object[]类型的,需要加个toArray()
1 $result = Db::name('style')
2     ->where('type', '=', $intId)
3     ->select()
4     ->toArray();
5 foreach ($result as $k=>$v){
6     $result[$k]['describe_pic'] = unserialize($v["describe_pic"]);
7 }


2.静态页面操作:
1 <foreach name="vo['describe_pic']" item="vo1" >
2     <img src="/upload/{$vo1}" alt="" style=" 40px;height: 40px">
3 </foreach>
人生得意须尽欢,莫使金樽空对月.
原文地址:https://www.cnblogs.com/luojie-/p/7458632.html