Skip to content

Latest commit

 

History

History
114 lines (71 loc) · 1.48 KB

README.md

File metadata and controls

114 lines (71 loc) · 1.48 KB

php-mobile-detector

Detect the Mobile Phones Using the PHP

Usage

Include File

<?php include 'mobile.php'; ?> 

Detect Any Mobile Device

<?php 
include 'mobile.php';
$mobile = new Mobile();

if ($mobile->isMobile) {
 header("Location: m.yoursite.com");
}

?>

Detect an Android Device

<?php
include 'mobile.php';
$mobile = new Mobile();

if ($mobile->isAndroid) {
 header("Location: android.yoursite.com");
}

?>

Detect an iPhone Device

<?php
include 'mobile.php';
$mobile = new Mobile();

if ($mobile->isIphone) {
 header("Location: iphone.yoursite.com");
}

?>

Other Detectable Devices

Blackberry = isBlackberry;
Ipod = isIpod;
Ipad = isIpad;
Opera Mini = isOperaMini; 
Palm = isPalm;
Windows = isWindows; 
Other = isOther; 

Detect an Android Device and Any Other Device at once

<?php
include 'mobile.php';
$mobile = new Mobile();

if ($mobile->isAndroid) {
 header("Location: android.yoursite.com");
} elseif ($mobile->isMobile) {
 header("Location: m.yoursite.com");
}

?>

Screenshoots

Not Detected

Detected an Android Device

Detected an iPhone Device

Detected an iPad Device