ด้วยสํานึกในพระมหากรุณาธิคุณสมเด็จพระนางเจ้าสิริกิติ์เป็นล้นพ้นอันหาที่สุดมิได้
ด้วยสํานึกในพระมหากรุณาธิคุณสมเด็จพระนางเจ้าสิริกิติ์เป็นล้นพ้นอันหาที่สุดมิได้


แนะนำ Mobile Detect php class พร้อมใช้ เช็คการใช้งาน ผ่าน มือถือ แท็บเล็ต

เขียนเมื่อ 13 ปีก่อน โดย Ninenik Narkdee
mobile detect mobile php

คำสั่ง การ กำหนด รูปแบบ ตัวอย่าง เทคนิค ลูกเล่น การประยุกต์ การใช้งาน เกี่ยวกับ mobile detect mobile php

ปัจจุบัน นักพัฒนาสามารถ ใช้ ChatGPT | Gemini | Claude | Perplexity | Deepseek ช่วยในการแก้ไขปัญหาต่างๆ ในการเขียนโปรแกรม หรือหาข้อมูลเพิ่มเติมได้ง่ายและสะดวก แนะนำให้ทุกคนใช้งานเพื่อพัฒนาศักยภาพของตัวเอง

ดูแล้ว 19,466 ครั้ง


 ไปโหลดมาใช้กันได้เลย ตามลิ้งค์นี้

 
เอาเฉพาะ โค้ตไฟล์ 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>
 
 
อ่านเพิ่มเติมที่หน้า ที่มา ตามลิ้งค์ข้างต้น













URL สำหรับอ้างอิง








เว็บไซต์ของเราให้บริการเนื้อหาบทความสำหรับนักพัฒนา โดยพึ่งพารายได้เล็กน้อยจากการแสดงโฆษณา โปรดสนับสนุนเว็บไซต์ของเราด้วยการปิดการใช้งานตัวปิดกั้นโฆษณา (Disable Ads Blocker) ขอบคุณครับ