作者:一切皆空2502861573 | 来源:互联网 | 2014-03-29 12:33
PHP数组混写输出HTML代码本帖最后由iyangquan于2013-12-2114:12:43编辑 $sql = "SELECT attr_value, thumb_url "." F
PHP数组混写输出HTML代码
本帖最后由 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);
thumb_url另外输出的值增加HTML代码,直接将图片显示出来
------解决方案--------------------$ysimg_arr[$val['thumb_url']] = "
";