我在API响应中获得了以下数据
{ secret: 'sn2MtJE1tDeESuuYcc7hBAJBGRABX', address: 'rwY9uCHHZkHTyns5Cwc5NHXLptkmNUs4Qv' }
我想要解析数组格式如下,使用php
array(secret=>sn2MtJE1tDeESuuYcc7hBAJBGRABX,address=>rwY9uCHHZkHTyns5Cwc5NHXLptkmNUs4Qv)
答案 0 :(得分:0)
$json = /* your json variable*/
$json = '{"secret":"sn2MtJE1tDeESuuYcc7hBAJBGRABX","address":"rwY9uCHHZkHTyns5Cwc5NHXLptkmNUs4Qv"}';
$array = json_decode($json,true);
print_r($array);
数组([secret] => sn2MtJE1tDeESuuYcc7hBAJBGRABX [地址] => rwY9uCHHZkHTyns5Cwc5NHXLptkmNUs4Qv)