服務器通常會根據訪問的瀏覽器進行識別,針對不一樣瀏覽器才用不一樣的網站樣式及結構,也是經過這個信息判斷用戶使用的平臺模式(手機,pc或平板)ios
識別爲手機通常有這幾個關鍵字: "Windows Phone","iPod","iPad","Android","ios","iPhone"瀏覽器
具體經常使用的幾類user-agent信息爲:服務器
1 火狐瀏覽器:iphone
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0網站
2 opera Mobileui
Opera/12.02 (Android 4.1; Linux; Opera Mobi/ADR-1111101157; U; en-US) Presto/2.9.201 Version/12.02rest
3 iphone的safari瀏覽器ip
Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543 Safari/419.3it
4 iphone的Chrome瀏覽器io
Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_1_1 like Mac OS X; en) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/19.0.1084.60 Mobile/9B206 Safari/7534.48.3
5 Chrome手機端
Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus Build/IMM76B)
AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.133 MobileSafari/535.19