PHP如何检测手机是什么系统?PHP如何通过UserAgent判断智能手机系统(设备,Android,IOS系统)?
auto.php
========================================================================
header("Content-type:text/html; charset=utf-8");
$user_agent = $_SERVER['HTTP_USER_AGENT'];
//var_dump($user_agent);
if(stristr($_SERVER['HTTP_USER_AGENT'],'Android')) {
//echo '你的手机是:Android系统';
header('Location: http://www.test.com/wap/android/test_1.3.apk');
}else if(stristr($_SERVER['HTTP_USER_AGENT'],'iPhone')){
//echo '你的手机是:ISO系统';
header('Location: http://itunes.apple.com/cn/appid493887471?mt=8');
}else{
//echo '你使用的是其他系统';
header('Location: http://m.test.com/');
}