我想改变这个
{"success":true,"data":{"transactionid":"83ad87ef-711a-4123-8273-92684daab934","messageid":"U3HuUCokq0PzvH0L7cIWiQ2"}}
{"success":true,"data":{"transactionid":"83ad87ef-711a-4123-8273-92684daab934","messageid":"U3HuUCokq0PzvH0L7cIWiQ2"}}
使用PHP进入数组...请指导..
答案 0 :(得分:1)
答案 1 :(得分:1)
使用json
函数将array
转换为json_decode()
,第二个参数为true
。就像这样..
$json = '{"success":true,"data":{"transactionid":"83ad87ef-711a-4123-8273-92684daab934","messageid":"U3HuUCokq0PzvH0L7cIWiQ2"}}';
$array = json_decode($json,true);
print_r($array);
<强>输出强>
Array
(
[success] => 1
[data] => Array
(
[transactionid] => 83ad87ef-711a-4123-8273-92684daab934
[messageid] => U3HuUCokq0PzvH0L7cIWiQ2
)
)
有关详情,请参阅文档json_decode()