真蛋疼啊
$result =array('result_code'=>'login_fail','user_id'=>0);
die(json_encode($result ));
php输出的json数组.
java(android)解析获取2个参数的 值
result 是获得到的string字符串
JSONObject jsonObject = new JSONObject(result);
String user_id = jsonObject.get("user_id").toString();
String result_code = jsonObject.get("result_code").toString();