欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

分享一个检测用户是否用手机(Mobile)访问网站的 PHP 类_PHP教程

程序员文章站 2022-04-26 13:36:58
...
有一个基于MIT License协议开源的PHP程序

http://code.google.com/p/php-mobile-detect/

程序就是一个文件,下载之后直接引用就可以。

使用方法:

include("Mobile_Detect.php");
$detect = new Mobile_Detect();
 
if ($detect->isMobile()) {
    // any mobile platform
    echo 'isMobile';
}
else{
    echo 'isPC';
}
?>

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/440205.htmlTechArticle有一个基于MIT License协议开源的PHP程序 http://code.google.com/p/php-mobile-detect/ 程序就是一个文件,下载之后直接引用就可以。 使用方法: ?php...