如何检测 Web 服务器上的移动客户端? [英] How do I detect mobile clients on my web server?
本文介绍了如何检测 Web 服务器上的移动客户端?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当 http 请求到达我的服务器时,我如何检测它是来自 iphone、android 还是其他设备?
When http request comes to my server, how do I detect if it is from iphone, android, or other devices?
推荐答案
您可以获取用户代理.这告诉它是什么浏览器类型(iphone,chrome,即,任何东西)
You can grab the User Agent. That tells what browser type it is (iphone, chrome, ie, anything)
帮助您:
http://en.wikipedia.org/wiki/User_agent
这篇关于如何检测 Web 服务器上的移动客户端?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文