Skip to content

Navigation Menu

Sign up
ChathulaPublic

About

Detect the Mobile Phones Using the PHP

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date

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

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

AltStyle によって変換されたページ (->オリジナル) /