1, 'data'=>$array]); } function resp_failed() { resp_header(); echo json_encode(['status'=>0]); } function resp_header() { header('Access-Control-Allow-Origin: *'); header('Content-Type: application/json; charset=UTF-8'); }