判断访问接口的设备是安卓还是ios
//判断是安卓还是ios function phontType(){ //全部变成小写字母 $agent = strtolower($_SERVER['HTTP_USER_AGENT']); $type = 'other'; //分别进行判断 if(strpos($agent, 'iphone') || strpos($agent, 'ipad')) { $type = 'ios'; } if(strpos($agent, 'android')) { $type = 'android'; } return $type; }