โหลดมาใช้กันได้
https://github.com/serbanghita/Mobile-Detect
เอาเฉพาะ โค้ตไฟล์ Mobile_Detect.php
https://github.com/serbanghita/Mobile-Detect/blob/master/Mobile_Detect.php
วิธีใช้งาน ไม่กี่บรรทัด
<?php include "Mobile_Detect.php"; $detect = new Mobile_Detect();
ใช้งานเบื้องต้น ตรวจสอบว่าเป็น มือถือ หรือแท็บเล็ต
<?php
if ($detect->isMobile()) {
// Any mobile device.
}
<?php
if($detect->isTablet()){
// Any tablet device.
}เช็คการใช้งานแบบเฉพาะเจาะจง
<?php
if($detect->isiOS()){
// Code to run for the Apple iOS platform.
}
<?php
if($detect->isAndroidOS()){
// Code to run for the Google Android platform.
}ต้วอย่าง เอาไปใช้งาน
<?php
include "Mobile_Detect.php";
$detect = new Mobile_Detect();
if($detect->isTablet()){
$URL="http://www.cymiz.com/tablet/";
echo "<meta http-equiv="refresh" content="0;URL=".$URL."" />";
exit;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>อ่านเพิ่ม
https://github.com/serbanghita/Mobile-Detect