php realizes scanning QR code and accessing different download addresses according to browser type

  • 2021-07-22 09:10:03
  • OfStack


<?php
$Agent = $_SERVER['HTTP_USER_AGENT'];
preg_match('/android|iphone/i',$Agent,$matches);
if (strtolower($matches[0]) == 'android') {
// echo " Android ";
header("Location: ".$GLOBALS["public_appconfig"]["app"]['android']."'");
} elseif (strtolower($matches[0]) == 'iphone') {
header("'Location: ".$GLOBALS["public_appconfig"]["app"]['ios']."'");
}else{
// Not sure what system it is or what it is pc
header("Location: ".$GLOBALS["public_appconfig"]["app"]['android']."'");
}
?>

Related articles: