Look directly at the code:

/** * Determine whether the requested device is a mobile device * @return bool
 */
function isMobile() {// If there is HTTP_X_WAP_PROFILE it must be a mobile deviceif (isset($_SERVER['HTTP_X_WAP_PROFILE']) {return true; } // If the via message contains WAP, it must be a mobile device. Some services will block this messageif (isset($_SERVER['HTTP_VIA']) && stristr($_SERVER['HTTP_VIA'].'wap')) {
        return true; } // A brutal method to determine the client flag sent by the phone, compatibility needs to be improvedif (isset($_SERVER['HTTP_USER_AGENT']) {$clientKeywords = ['nokia'.'sony'.'ericsson'.'mot'.'samsung'.'htc'.'sgh'.'lg'.'sharp'.'sie-'.'philips'.'panasonic'.'alcatel'.'lenovo'.'iphone'.'ipod'.'blackberry'.'meizu'.'android'.'netfront'.'symbian'.'ucweb'.'windowsce'.'palm'.'operamini'.'operamobi'.'openwave'.'nexusone'.'cldc'.'midp'.'wap'.'mobile']; // Find the mobile browser keyword from HTTP_USER_AGENTif (preg_match("/".implode('|'.$clientKeywords).")/i", strtolower($_SERVER['HTTP_USER_AGENT'))) {return true; }} // Protocol method, because may not be accurate, put it to the last judgmentif (isset($_SERVER['HTTP_ACCEPT'])) {// If only WML is supported and HTML is not supported, it must be a mobile deviceif ((strpos($_SERVER['HTTP_ACCEPT'].'vnd.wap.wml')! = =false) && (strpos($_SERVER['HTTP_ACCEPT'].'text/html') = = =false || (strpos($_SERVER['HTTP_ACCEPT'].'vnd.wap.wml') < strpos($_SERVER['HTTP_ACCEPT'].'text/html')))) {
            return true; }}return false;
}Copy the code