如何识别访问者的手机是否是基于windows的?我有iPhone和Android的代码,但有人可以帮助基于windows的手机吗?
$iPhone = stripos($_SERVER['HTTP_USER_AGENT'],"iPhone");
$Android = stripos($_SERVER['HTTP_USER_AGENT'],"Android");发布于 2014-05-07 15:03:34
var isMobile = {
Android: function() {
return navigator.userAgent.match(/Android/i);
},
BlackBerry: function() {
return navigator.userAgent.match(/BlackBerry/i);
},
iOS: function() {
return navigator.userAgent.match(/iPhone|iPad|iPod/i);
},
Opera: function() {
return navigator.userAgent.match(/Opera Mini/i);
},
Windows: function() {
return navigator.userAgent.match(/IEMobile/i);
},
any: function() {
return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
}
};发布于 2014-05-07 14:51:34
尝试使用您选择的语言:http://detectmobilebrowsers.com
如果您想在HTTP服务器级别执行此操作,甚至可以使用apache和nginx的脚本。
发布于 2014-05-07 15:02:14
似乎是"Windows Phone“为WP8和"Windows Phone OS”为以前的版本。但您也可以查找浏览器代理"IEMobile“。
我建议你阅读这篇文章:http://blogs.windows.com/windows_phone/b/wpdev/archive/2012/10/17/getting-websites-ready-for-internet-explorer-10-on-windows-phone-8.aspx
如果仍然不能工作,只需尝试在连接windows phone时登录用户代理,您就会得到解决方案。
https://stackoverflow.com/questions/23510683
复制相似问题