请求接口的客户端类型判断123456789101112$userAgent = $_SERVER['HTTP_USER_AGENT'];if (preg_match("/(iPod|iPad|iPhone)/", $userAgent)){ $type = 1; //IOS客户端}elseif (preg_match("/WP/", $userAgent)){ $type = 2; //WinPhone客户端}elseif (preg_match("/android/i", $userAgent)) { $type = 3; //android客户端}