php - Unable to parse JSON web service response with json_decode() -
i'm struggling parsing web service response json in cases service returns error. example json - success flow: { "response": [{ "iconpath" : "/img/theme/destiny/icons/icon_psn.png", "membershiptype": 2, "membershipid": "4611686018429261138", "displayname": "spuff_monkey" }], "errorcode": 1, "throttleseconds": 0, "errorstatus": "success", "message": "ok", "messagedata":{} } example json - error flow: { "errorcode": 7, "throttleseconds": 0, "errorstatus": "parameterparsefailure", "message": "unable parse parameters. please correct them, , try again.", "messagedata": {} } now php: function hitwebservice($endpoint) { $curl = curl_init($endpoint); curl_setopt($c...