Json data is returned. after json_decode, it is null zhidao. baidu. comlink? Callback: The problem I encountered is similar to that of calling the app interface. then, php accepts and returns the jso json data. after json_decode, it is null.
Http://zhidao.baidu.com/link? Url = response
The problem I encountered is similar to that of him.
Call the app interface, and then php accepts the returned json string (the format is correct after verification): the returned data is inconsistent with the actual characters (three more characters ),
Change the php end to a json header or not
Returned by the app:
String (121 )"? {"ErrorCode": "0", "errorMsg": "success", "responseData": {"uid": "36", "sender_uid": "37 ", "error": "0", "error_msg": "success "}}"
Json_decode-> NULL
Copy to File:
String (118) "{" errorCode ":" 0 "," errorMsg ":" success "," responseData ": {" uid ":" 36 "," sender_uid ": "37", "error": "0", "error_msg": "success "}}"
Json
Share: More
------ Solution --------------------
Why is the BOM header?
------ Solution --------------------
The BOM header contains three more characters. you can remove it.
For example, if the received value is in $ s
$ A = json_decode (substr ($ s, 3 ));