如何在手机和手机之间进行检测PHP中的平板电脑 [英] How to detect between mobile & tablets in PHP
本文介绍了如何在手机和手机之间进行检测PHP中的平板电脑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在此线程上阅读: 检测移动设备的最简单方法 关于如何知道浏览器是否是移动设备的信息.通用代码是这样的:
I read on this thread: Simplest way to detect a mobile device on how to know if the browser is a mobile device. the general code is this:
<?php include("Mobile_Detect.php"); include("demoData.php");
$detectIsMobile = new Mobile_Detect(); ?>
问题是我想治疗平板电脑(iPad和xoom).
The problem is that I want to treat tablets (iPad & xoom).
我看到那里已经测试了一个isIpad()函数-但这仍然不能解决平板电脑和手机之间的区别.
I saw there that there is a isIpad() function that I have tested yet - but that still doesn't solve the difference between tablets and mobile phones.
有什么主意吗?
谢谢, 阿隆
推荐答案
使用
<?php
if($detect->isTablet()){
// any tablet
}
?>
您可以参考此页面以获取更多信息 http://code.google.com /p/php-mobile-detect/
You can refer this page for more info http://code.google.com/p/php-mobile-detect/
这篇关于如何在手机和手机之间进行检测PHP中的平板电脑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文