Home  >  Article  >  Backend Development  >  php实现扫描二维码根据浏览器类型访问不同下载地址_PHP

php实现扫描二维码根据浏览器类型访问不同下载地址_PHP

WBOY
WBOYOriginal
2016-05-31 19:29:21788browse

<&#63;php
$Agent = $_SERVER['HTTP_USER_AGENT'];
preg_match('/android|iphone/i',$Agent,$matches);
if (strtolower($matches[0]) == 'android') {
// echo "安卓";
header("Location: ".$GLOBALS["public_appconfig"]["app"]['android']."'");
} elseif (strtolower($matches[0]) == 'iphone') {
header("'Location: ".$GLOBALS["public_appconfig"]["app"]['ios']."'");
}else{
//不确定是什么系统或者是pc
header("Location: ".$GLOBALS["public_appconfig"]["app"]['android']."'");
}
&#63;>

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