我在这个线程上读到: Simplest way to detect a mobile device 关于如何知道浏览器是否是移动设备。一般代码是这样的:
<?php include("Mobile_Detect.php"); include("demoData.php");
$detectIsMobile = new Mobile_Detect(); ?>
问题是我想治疗平板电脑(iPad 和 xoom)。
我看到那里有一个我已经测试过的 isIpad() 函数 - 但仍然没有解决平板电脑和手机之间的区别。
有什么想法吗?
谢谢, 阿隆
最佳答案
使用
<?php
if($detect->isTablet()){
// any tablet
}
?>
您可以引用此页面了解更多信息http://code.google.com/p/php-mobile-detect/
关于php - 如何在PHP中检测手机和平板电脑,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8328448/