function isMobile()
{
// If there is HTTP_X_WAP_PROFILE, it must be a mobile device
if (isset ($_SERVER['HTTP_X_WAP_PROFILE']))
{
return true;
}
//If the via information contains wap then It must be a mobile device, some service providers will block this information
if (isset ($_SERVER['HTTP_VIA']))
{
// If not found, it is false, otherwise it is true
return stristr($_SERVER['HTTP_VIA'] , "wap") ? true : false;
}
// Brainless method, judge the client flag sent by the mobile phone, compatibility needs to be improved
if (isset ($_SERVER['HTTP_USER_AGENT']))
{
$clientkeywords = array ('nokia',
'sony',
'ericsson',
'mot',
'samsung',
'htc',
'sgh',
'lg',
'sgh',
'sharp',
'sie- ',
'ipod',
'blackberry',
'meizu',
'android',
'netfront ',
'symbian',
'ucweb',
'windowsce',
'palm',
'operamobi',
'openwave',
'nexusone',
'cldc',
'midp ',
clientkeywords) . ")/ i", strtolower($_SERVER['HTTP_USER_AGENT'])))
VER[' HTTP_ACCEPT']))
{// If it supports WML and HTML, but WML is a mobile device
IF (Strpos ($ _ _ Server ['http_accept'], 'vand.wap.wml')! == False) && (STRPOS ($ _ Server [ 'HTTP_ACCEPT'], 'text/html') === false || (strpos($_SERVER['HTTP_ACCEPT'], 'vnd.wap.wml') .