美文网首页
使用 mobiledetectlib 检测客户端设备类型

使用 mobiledetectlib 检测客户端设备类型

作者: 骑蚂蚁上高速_jun | 来源:发表于2020-01-31 20:25 被阅读0次
  1. composer 安装包
    composer require mobiledetect/mobiledetectlib

  2. 使用教程

$detect = new Mobile_Detect;
$detect->isMobile();
$detect->isTablet();

// Magic methods.
$detect->isIphone();
$detect->isSamsung();

// Alternative to magic methods.
$detect->is('iphone');

// Find the version of component.
$detect->version('Android');

// Additional match method.
$detect->match('regex.*here');

3.更多使用方法
https://github.com/serbanghita/Mobile-Detect/wiki/Code-examples

相关文章

网友评论

      本文标题:使用 mobiledetectlib 检测客户端设备类型

      本文链接:https://www.haomeiwen.com/subject/slhnthtx.html