真蛋疼啊
$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();