system/helper/device.php
(开头部分) 77KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
function is_mobile()
{
return (new Mobile_Detect)->isMobile() && !(new Mobile_Detect)->isTablet();
}
function is_tablet()
{
return (new Mobile_Detect)->isTablet();
}
function is_desktop()
{
return !(new Mobile_Detect)->isMobile() && !(new Mobile_Detect)->isTablet();
}
function is_weixin()
{
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false) {
return true;
} else {
return false;
}
}
/**
* Mobile Detect Library
* =====================
*
* Motto: "Every business should have a mobile detection script to detect mobile readers"
*
* Mobile_Detect is a lightweight PHP class for detecting mobile devices (including tablets).
* It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment.
*
* @author Current authors: Serban Ghita <serbanghita@gmail.com>
* Nick Ilyin <nick.ilyin@gmail.com>
*
* Original author: Victor Stanciu <vic.stanciu@gmail.com>
*
* @license Code and contributions have 'MIT License'
* More details: https://github.com/serbanghita/Mobile-Detect/blob/master/LICENSE.txt
*
* @link Homepage: http://mobiledetect.net
* GitHub Repo: https://github.com/serbanghita/Mobile-Detect
* Google Code: http://code.google.com/p/php-mobile-detect/
* README: https://github.com/serbanghita/Mobile-Detect/blob/master/README.md
* HOWTO: https://github.com/serbanghita/Mobile-Detect/wiki/Code-examples
*
* @version 2.8.24
*/
class Mobile_Detect
{
/**
* Mobile detection type.
*
* @deprecated since version 2.6.9
*/
const DETECTION_TYPE_MOBILE = 'mobile';
/**
后面还有 1423 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
