Php-json multi-dimensional array processing, how to set the value. An ajax call gets a string of return values from Alibaba's big fish api. {"Alibaba_aliqin_fc_sms_num_send_response": {"result": {"err_code": "0", "model": "101119416903 ^ 1101601857156", "success": true }, "request_id": "1476c431qgbi4 "}}
I can use $ starr = json_decode ($ str, true); to get the $ starr array. But how do I obtain the success data in the array $ starr? I need success for further judgment. And. Is the returned value json data? If yes, I will upload it to the front-end using jquery ajax. How can we get the success value?
Reply to discussion (solution)
$str = '{"alibaba_aliqin_fc_sms_num_send_response":{"result":{"err_code":"0","model":"101119416903^1101601857156","success":true},"request_id":"1476c431qgbi4"}}';$starr= json_decode($str,true);echo $starr['alibaba_aliqin_fc_sms_num_send_response']['result']['success'];
Js:
Json. alibaba_aliqin_fc_sms_num_send_response.result.success
You can also write
Json ['alibabaca_aliqin_fc_sms_num_send_response'] ['result'] ['success']
Yes. Upstairs, I have successfully called it. $ Starr [0] [0] [1] and so on cannot be used.