public static function is_mobile()
    {
        if (!isset($_SERVER['HTTP_ACCEPT'])) {
            return false;
        }

        $accept = $_SERVER['HTTP_ACCEPT'];

        if (isset($_SERVER['HTTP_X_WAP_PROFILE']) || isset($_SERVER['HTTP_PROFILE']))
        {
            return true;
        }
        elseif (strpos($accept, 'text/vnd.wap.wml') > 0 || strpos($accept, 'application/vnd.wap.xhtml+xml') > 0)
        {
            return true;
        }
        else
        {
            foreach (array_keys(self::$devices) as $device)
            {
                if (self::is_device($device)) return true;
            }
        }
        return false;
    }
public static function is_mobile()
    {
        if (!isset($_SERVER['HTTP_ACCEPT'])) {
            return false;
        }

        $accept = $_SERVER['HTTP_ACCEPT'];

        if (isset($_SERVER['HTTP_X_WAP_PROFILE']) || isset($_SERVER['HTTP_PROFILE']))
        {
            return true;
        }
        elseif (strpos($accept, 'text/vnd.wap.wml') > 0 || strpos($accept, 'application/vnd.wap.xhtml+xml') > 0)
        {
            return true;
        }
        else
        {
            foreach (array_keys(self::$devices) as $device)
            {
                if (self::is_device($device)) return true;
            }
        }
        return false;
    }
public static function is_mobile ( ) { if ( ! isset ( $ _SERVER [ 'HTTP_ACCEPT' ] ) ) { return false ; } $ accept = $ _SERVER [ 'HTTP_ACCEPT' ] ; if ( isset ( $ _SERVER [ 'HTTP_X_WAP_PROFILE' ] ) || isset ( $ _SERVER [ 'HTTP_PROFILE' ] ) ) { return true ; } elseif ( strpos ( $ accept , 'text/vnd.wap.wml' ) > 0 || strpos ( $ accept , 'application/vnd.wap.xhtml+xml' ) > 0 ) { return true ; } else { foreach ( array_keys ( self :: $ devices ) as $ device ) { if ( self :: is_device ( $ device ) ) return true ; } } return false ; }
Check if we are in the mobile mode

@return bool
Check if we are in the mobile mode