table('goods_attr') .'where "/> table('goods_attr') .'where ">
Home > Backend Development > PHP Tutorial > PHP数组混写输出HTML代码,该如何处理

PHP数组混写输出HTML代码,该如何处理

WBOY
Release: 2016-06-13 12:29:46
Original
867 people have browsed it

PHP数组混写输出HTML代码

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



thumb_url另外输出的值增加HTML代码,直接将图片显示出来$ysimg_arr[$val['thumb_url']] = " PHP数组混写输出HTML代码,该如何处理 ";

Related labels:
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