PHP array mixed-write output HTML code workaround

Source: Internet
Author: User
PHP array mixed-write output HTML code
This post was last edited by Iyangquan on 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 ';

$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 additional output values add HTML code to display the image directly

Share to: more


------Solution--------------------
$ysimg _arr[$val [' thumb_url ']] = "";
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.