Skip to content

Chathula/php-mobile-detector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

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

About

Detect the Mobile Phones Using the PHP

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages