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

原创 2017-02-18 11:13:26 362
摘要:本程序实现的功能就是扫描同一个二维码根据浏览器类型访问不同下载地址:<?php $Agent = $_SERVER['HTTP_USER_AGENT']; preg_match('/android|iphone/i',$Agent,$matches); if (strtolower($matches[0]) ==&nbs

本程序实现的功能就是扫描同一个二维码根据浏览器类型访问不同下载地址:

<?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']."'");
}
?>

更多关于php实现扫描二维码根据浏览器类型访问不同下载地址请关注PHP中文网(www.php.cn)其他文章!

发布手记

热门词条