每个版本的iPhone都有不同的用户代理吗?
答案 0 :(得分:2)
请参阅:http://www.gtrifonov.com/blog/2009/04/08/IPhone_User_Agent_Strings.aspx
| Mozilla/5.0 (iPhone; U; XXXXX like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/241 Safari/419.3 |
| Mozilla/5.0 (iPhone; U; XXXXX like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A477c Safari/419.3 |
| Mozilla/5.0 (iPhone; U; XXXXX like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A477d Safari/419.3 |
| Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A498b Safari/419.3 |
| Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A535b Safari/419.3 |
| Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A538b Safari/419.3 |
| Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3 |
| Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Kevin) Version/3.0 Mobile/1A543a Safari/419.3 |
| Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A566a Safari/419.3 |
| Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1C9 Safari/419.3 |
| Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1C10 Safari/419.3 |
| Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A522a Safari/419.3 |
| Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1C6 Safari/419.3 |
| Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A537a Safari/419.3 |
此外,仅适用于iPhone:
IOS Ver HW DeviceUserAgent
3 iPhone Apple-iPhone/701.341
3.1 iPhone Apple-iPhone/703.144
4 iPhone 3G Apple-iPhone1C2/801.293
4 iPhone 3GS Apple-iPhone2C1/801.293
4 iPhone 4 Apple-iPhone3C1/801.293
4.1 iPhone Apple-iPhone/508.11
3.0.1 iPhone Apple-iPhone/701.400
3.1.2 iPhone Apple-iPhone/704.11
3.1.3 iPhone Apple-iPhone/705.18
4.0.1 iPhone 3G Apple-iPhone1C2/801.306
4.0.1 iPhone 3GS Apple-iPhone2C1/801.306
4.0.1 iPhone 4 Apple-iPhone3C1/801.306
答案 1 :(得分:0)
preg_match('/Apple.*Mobile.*Safari/', $_SERVER['HTTP_USER_AGENT'])
包含适用于iPhone和iPod Touch的安全正则表达式