+ -

php检测用户是否用手机(Mobile)访问网站的类

时间:2021-01-20

来源:互联网

在手机上看
手机扫描阅读

PHP检测用户是否用手机(Mobile)访问网站的类,引入这个类就可以直接使用了,程序基于MIT License协议开源,有需要的朋友快来php爱好者看看吧。

下载地址http://code.google.com/p/php-mobile-detect/

程序就是一个文件,下载之后直接引用就可以,基于MIT License协议开源的PHP程序

使用方法:

代码如下:

<?php

include("Mobile_Detect.php");

$detect = new Mobile_Detect();

if ($detect->isMobile()) {

    // any mobile platform

    echo 'isMobile';

}

else{

    echo 'isPC';

}

?>