(1)如果返回值是JSON
json_decode($res,true);【如果不设置true,将会变成对象】
$res =httpRequest($url,'post',$data);
$json_array = json_decode($res,true);
$data=$json_array['data']['admin_user_list'];
$this->assign('json_array',$data);
$this->display();
(2)如果返回值是XML
simplexml_load_string($xml);
$xml =httpRequest($url,'post',$data);
$judge = simplexml_load_string($xml);
if($judge[0] == 'ok' && $res !==false){
$response['status']=666;
$response['judge'] = $judge[0];
$response['msg']="交接成功";
}else{
$response['status']=555;
$response['judge'] = $judge[0];
$response['msg']="交接失败";
}
$this->ajaxreturn($response);