ไปโหลดมาใช้กันได้เลย ตามลิ้งค์นี้
เอาเฉพาะ โค้ตไฟล์ 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
<?php
include "Mobile_Detect.php";
$detect = new Mobile_Detect();
if($detect->isTablet()){
$URL="https://www.ninenik.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>
<body>
</body>
</html>
อ่านเพิ่มเติมที่หน้า ที่มา ตามลิ้งค์ข้างต้น