Http://zhidao.baidu.com/link?url=kEYMQrLi41ZyC3Yo5XoN_QEbUentL2yVvcUg3seg_ZVksV2w5KBMudlQomrizXZiEoe3Uz0xtp7Moj9nRLBLNK
I have the same problem as him.
Call the app interface, and then PHP accepts the return JSON string (well-formed after validation): The returned data does not match the actual character (three characters more),
And then change the PHP to a JSON header or not.
The app returns:
String (121) "? {"ErrorCode": "0", "errormsg": "Success", "ResponseData": {"UID": "$", "Sender_uid": "PNs", "Error": "0", "error_msg": " Success "}}"
Json_decode->null
Copied to the file:
String (118) "{" ErrorCode ":" 0 "," errormsg ":" Success "," ResponseData ": {" UID ":" $ "," Sender_uid ":" PNs "," Error ":" 0 "," Error_msg ":" Success "}}"
Reply to discussion (solution)
BOM Header reasons for it
More than three characters are BOM head, remove on it can be
For example, if received in the $s, then
$a = Json_decode (substr ($s, 3));
More than three characters are BOM head, remove on it can be
For example, if received in the $s, then
$a = Json_decode (substr ($s, 3));
Go to the company tomorrow and try it.
More than three characters are BOM head, remove on it can be
For example, if received in the $s, then
$a = Json_decode (substr ($s, 3));
With the Baidu push sent, and looked for several hours, the original Baidu a document with BOM head, Egg pain dead!!! Thank you.
BOM Header reasons for it
All right, thank you.
Recommend a JSON format tool, JSON validation tool, http://www.sojson.com
No Ads loaded fast tools