PHP如何解析来自android post请求的HashMap数据?

时间:2015-12-17 05:54:29

标签: php android

@Override
protected String doInBackground(String... params) {

     HashMap<String, String> data = new HashMap<String,String>();
     data.put("name",params[0]);
     data.put("username",params[1]);
     data.put("password",params[2]);
     data.put("email",params[3]);

     String result = ruc.sendPostRequest(REGISTER_URL,data);

     return  result;
}

这是PHP代码:

if($_SERVER['REQUEST_METHOD']=='POST'){
    $name = $_POST['name'];
    $username = $_POST['username'];
    $password = $_POST['password'];
    $email = $_POST['email'];
}

php如何解析HashMap?我是新手,谢谢你的答案!

0 个答案:

没有答案