PHP array mixed write output HTML code & nbsp; $ SQL & nbsp; SELECT & nbsp; attr_value, & nbsp; thumb_url & nbsp ;. & nbsp; FROM & nbsp ;. & nbsp; $ GLOBALS [ecs]-& gt; table (goods_attr ). where & nbsp; go PHP array mixed write output HTML code
$ 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 adds HTML code to the output value and displays the image directly.
------ Solution --------------------
$ Ysimg_arr [$ val ['thumb _ url'] = "";