从php中的URL获取json数据的问题


Issue in obtaining json data from the URL in php

大家好,我正在为移动应用程序开发web服务,在我的情况下,来自移动设备的数据将以json格式接收,问题是我无法解码json数据,只有我可以获得它的post值

json从手机发送数据

test:{"username":"abc1234","emailid":"abc@asd.com","password":"abc123","transactionpassword":"abc1234","phone":"1234567890","secretquestion":"What is the name of my pet?","secretanswer":"Tom"}

得到的数组
print_r($_POST);
    Array
    (
        [------WebKitFormBoundaryXb9aAj9gBd1dA41z
    Content-Disposition:_form-data;_name] => "test"
    {"username":"abc1234","emailid":"abc@asd.com","password":"abc123","transactionpassword":"abc1234","phone":"1234567890","secretquestion":"What is the name of my pet?","secretanswer":"Tom"}
    ------WebKitFormBoundaryXb9aAj9gBd1dA41z--
    )

当我试图解码它没有结果显示

print_r(json_decode($_POST));

帮助我解码json数据在php

看起来应该先获取实际的POST参数

json_decode($_POST['test'])