《PHP實例:php實現掃描二維碼根據瀏覽器類型訪問不同下載地址》要點:
本文介紹了PHP實例:php實現掃描二維碼根據瀏覽器類型訪問不同下載地址,希望對您有用。如果有疑問,可以聯系我們。
PHP實戰
<?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實現掃描二維碼根據瀏覽器類型訪問不同下載地址》討論,分享您的想法,維易PHP學院為您提供專業教程。