通过判断浏览器的userAgent,用正则来判断手机是否是
ios
和
Android
客户端。
代码
如下:
使用方法:
检测浏览器语言:
第二种:来自http://www.fufuok.com/js-iphone-android.html
原文链接:http://caibaojian.com/browser-ios-or-android.html
下面一个比较全面的浏览器检查函数,提供更多的检查内容,你可以检查是否是移动端(Mobile)、ipad、iphone、微信、QQ等。·
第一种:来自http://blog.baiwand.com/?post=176
使用方法:
检测浏览器语言:
第二种:来自http://www.fufuok.com/js-iphone-android.html
原文链接:http://caibaojian.com/browser-ios-or-android.html
【推荐】·
PHP 检测终端类:
Mobile Detect - lightweight PHP class for detecting mobile devices (including tablets)