Getting the type of mobile phone

China☆狼群 提交于 2019-12-22 19:03:10

问题


Is there a way to get the type of mobile Phone when a phone connects to a mobi site using PHP?


回答1:


You can read the user agent with PHP, and this might give you a clue.

http://detectmobilebrowsers.mobi/ <- Free function to read read the user agent with PHP.




回答2:


Look at wurfl. It can match all 28000something different user-agent headers to a specific mobile phone and give you it's attributes (sreenwidht/screenheight/canplayvideo/etc)




回答3:


I think your only way is to parse the user agent HTTP header. You'll get that information in the global variable $_SERVER['HTTP_USER_AGENT']. See http://php.about.com/od/learnphp/p/http_user_agent.htm




回答4:


There is a working draft from de W3C called Device Description Repository Simple API. There is a DDR Service, a reference implementation that can work with WURFL, DeviceAtlas, and UAProf under the hood.



来源:https://stackoverflow.com/questions/1686000/getting-the-type-of-mobile-phone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!