Home >Backend Development >PHP Tutorial >取得客户端浏览器和OS的基本信息_PHP

取得客户端浏览器和OS的基本信息_PHP

WBOY
WBOYOriginal
2016-06-01 12:36:481029browse

$Agent=$_SERVER["HTTP_USER_AGENT"];
for($tmpa=0;$tmpa $regex.="(.+);";
}
ereg("\($regex+(.+)\)",$Agent,$cz);
for($tmpb=2;$tmpb $_C[]=strtolower(trim($cz[$tmpb]));
}
if(count($cz)>4){
echo "用户代理字符串:".$cz[4];
}
?>

以上你可以用$cz[2] 这个是浏览器的标识,$cz[3]是系统的标识
$cz[4] 这个基本很少有用户增加的

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn