我有像这样的SQL查询来使用自动完成:
SELECT concat(prop_name,', ',prov_name,', ',name,'<br><span class=".$class.">',address,'</span>'),prop_name as value ,4 as orders FROM v_property
当我像这样循环时
foreach ($data as $row) {
$array[]=$row->name;
}
header("Content-type:text/x-json");
echo json_encode($array);
结果:
Phnom Penh Hotel, Battambang, Cambodia<br><span class=adr>P.O Box 93193, Wat Damnak Village, Sangkat Sala Kamreuk Siem Reap, Cambodia 17107</span>
但我希望用这样的html显示结果:
Phnom Penh Hotel, Battambang, Cambodia
P.O Box 93193, Wat Damnak Village, Sangkat Sala Kamreuk Siem Reap, Cambodia 17107