PHP Classes

File: index2.php

Recommend this page to a friend!
  Classes of Harry Kämpf   Mobile Detection   index2.php   Download  
File: index2.php
Role: Example script
Content type: text/plain
Description: example for switch content in the same page
Class: Mobile Detection
Detect mobile devices from request headers
Author: By
Last change: Bug fixing
Date: 9 years ago
Size: 1,435 bytes


Class file image Download
$strHtml = '';
if (
$objMobile->IsMobile()) {
$strHtml .= '<?xml version="1.0" encoding="UTF-8"?>'."\n";
$strHtml .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "">'."\n";
$strHtml .= '<html xmlns="" xml:lang="de">'."\n";
$strHtml .= '<head>'."\n";
$strHtml .= "\t".'<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=1" />'."\n";
$strHtml .= "\t".'<link rel="stylesheet" type="text/css" href="./css/style_mobile-min.css" />'."\n";
} else {
$strHtml .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">'."\n";
$strHtml .= '<html xmlns="" xml:lang="de" lang="de">'."\n";
$strHtml .= '<head>'."\n";
$strHtml .= "\t".'<link rel="stylesheet" type="text/css" href="./css/style-min.css" media="screen" />'."\n";
$strHtml .= "\t".'<link rel="stylesheet" type="text/css" href="./css/style_print-min.css" media="print" />'."\n";
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta http-equiv="content-language" content="de" />
    <meta name="author" content="Harry Kämpf" />
    <link rel="shortcut icon" href="favicon.ico" />
    <title>Your title...</title>