数组:
Array
(
[0] => Array
(
[productid] => 2
[cateid] => 4
[title] => 衣
[descr] => 吖吖吖吖吖吖吖吖吖吖吖吖吖吖吖吖吖吖吖吖吖
[num] => 197
[price] => 888.00
[cover] => 7xpizy.com1.z0.glb.clouddn.com/58087fa893aa7
[pics] => {"58087faa67f8b":"7xpizy.com1.z0.glb.clouddn.com\/58087faa67f8b"}
[issale] => 1
[saleprice] => 799.00
[ishot] => 1
[istui] => 1
[ison] => 1
[createtime] => 0
)
)
json :
[{"productid":"2","cateid":"4","title":"\u8863","descr":"\u5416\u5416\u5416\u5416\u5416\u5416\u5416\u5416\u5416\u5416\u5416\u5416\u5416\u5416\u5416\u5416\u5416\u5416\u5416\u5416\u5416","num":"197","price":"888.00","cover":"7xpizy.com1.z0.glb.clouddn.com\/58087fa893aa7","pics":"{\"58087faa67f8b\":\"7xpizy.com1.z0.glb.clouddn.com\\\/58087faa67f8b\"}","issale":"1","saleprice":"799.00","ishot":"1","istui":"0","ison":"1","createtime":"0"}]
数组中的 pics 本来就是json了,然后 json_encode
后在js中 JSON.parse
会报错:
Unexpected number in JSON at position 169
对原数组进行处理,json部分转成数组