q82711031 发表于 2014-1-13 12:00:41

php 手机系统 php-mobile-detect

官方网站:
PHP Mobile Detect
是一个用于判断移动设备类型的开源PHP类。它通过调用与HTTP head关联的User-Agent字符串,判断具体的设备使用环境。 除了能够判断是手机、平板还是PC,Mobile Detect还能探测到用户使用的是iPhone、iPad、Android还是黑莓的设备等等。如果有需要,Mobile Detect还能分辨出系统版本号、使用的浏览器等信息。
代码示例:include("Mobile_Detect.php");
$detect = new Mobile_Detect();
if($detect->iOS()){
    // code to run for the Apple iOS platform.
}
if($detect->isAndroidOS()){
    // code to run for the Google Android platform.
}
if ($detect->isMobile()) {
    // any mobile platform
}
if($detect->isTablet()){
    // any tablet
}Mobile Detect的设备数据库还是比较丰富的——除了基本的iOS、Android设备之外,它还存储了像Nook、Kindle、Archos等相对小众的设备。数据库中的浏览器类型也很丰富,开发者可以利用它们进行深入的探测。
{:soso_e113:}部分资料参考 米花网 wWw.miHUa.NET/list/3/3571.htm
页: [1]
查看完整版本: php 手机系统 php-mobile-detect