Home > Backend Development > PHP Tutorial > PHP数组混写输出HTML代码

PHP数组混写输出HTML代码

WBOY
Release: 2016-06-23 14:39:54
Original
1752 people have browsed it

本帖最后由 iyangquan 于 2013-12-21 14:12:43 编辑


		 $sql = "SELECT attr_value, thumb_url "." FROM " . $GLOBALS['ecs']->table('goods_attr')						.'where goods_id='.$row['goods_id'].' and attr_id=185 order by attr_value asc';				  $cm = $GLOBALS['db']->getAll($sql); 				  $ys_arr=array();				  $ysimg_arr=array();				  foreach ($cm as $val)				  {				  	  $ys_arr[$val['attr_value']] = $val['attr_value'];				  	  $ysimg_arr[$val['thumb_url']] = $val['thumb_url'];				  }				  $arr[$row['goods_id']]['attr_value'] =implode('、',$ys_arr);				  $arr[$row['goods_id']]['thumb_url'] =implode(' ',$ysimg_arr);
Copy after login



thumb_url另外输出的值增加HTML代码,直接将图片显示出来

回复讨论(解决方案)

不知道你要做什么

不知道你要做什么

thumb_url这个值现在输出的是图片完整地址,我想加入PHP数组混写输出HTML代码
混写入HTML输出

$ysimg_arr[$val['thumb_url']] = "PHP数组混写输出HTML代码";

$ysimg_arr[$val['thumb_url']] = "PHP数组混写输出HTML代码";

多谢
大括号少了个

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template