如何使用 PHP
在此 JSON 代码中打印成功消息{
"status": 0,
" result":{
"status":"success"
}
}
答案 0 :(得分:0)
$response = {"status":"success"};
$data = json_decode(response ,TRUE); //converts to associative array
if($data['status'] == 'success'){
echo 'You are success';
}
答案 1 :(得分:0)
$result = json_decode('{
"status": 0,
" result":{
"status":"success"
}
}');
echo $result['result']['status'];
答案 2 :(得分:-1)