? ?后臺采用json字符串做響應時,如果數(shù)據(jù)中已經(jīng)有了事先json_encode過的值,則再經(jīng)過json_encode傳到前端則會被轉(zhuǎn)義。
例子數(shù)據(jù):
array(
'a'=>'a',
'b'=>'{"shopName":"123","shopIntroduce":"123"}'
);
json_encode之后 string(64) "{"a":"a","b":"{\"shopName\":\"123\",\"shopIntroduce\":\"123\"}"}"就被轉(zhuǎn)義了
解決方案:
遍歷array 將json數(shù)組json_decode 然后再json_encode即可正常顯示