Home > php教程 > php手册 > body text

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

WBOY
Release: 2016-06-06 20:25:51
Original
1511 people have browsed it

php检测用户是否用手机(Mobile)访问网站的类,引入这个类就可以直接使用了,程序基于MIT License协议开源,使用方法在下面

下载地址

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

使用方法:

复制代码 代码如下:


include("Mobile_Detect.php");
$detect = new Mobile_Detect();

if ($detect->isMobile()) {
    // any mobile platform
    echo 'isMobile';
}
else{
    echo 'isPC';
}
?>

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!