承接 czepter/detect-device 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

czepter/detect-device

Composer 安装命令:

composer require czepter/detect-device

包简介

fork of the incredible work of Kevin Warren (detectdevice.com). Easy to use lib for device detection.

README 文档

README

Simply include or require the class file & use. No need to instantiate the class as all methods are static:

require_once '../vendor/autoload.php';
require_once '../src/Detect.php';

// Any mobile device (phones or tablets)
if (Detect\Detect::isMobile()) {
	echo 'is mobile!';
}

// Gets the device type ('Computer', 'Phone' or 'Tablet')
echo Detect\Detect::deviceType();

// Any phone device
if (Detect\Detect::isPhone()) {
	echo 'is phone!';
}

// Any tablet device
if (Detect\Detect::isTablet()) {
	echo 'is tablet!';
}

// Any computer device (desktops or laptops)
if (Detect\Detect::isComputer()) {
	echo 'is computer!';
}

// Get the IP address of the device
echo Detect\Detect::ip();

// Get the ID address host name of the device
echo Detect\Detect::ipHostname();

// Get the IP address organisation of the device
echo Detect\Detect::ipOrg();

// Get the country the IP address is in (IP address location inaccurate)
// (JS function available which uses the Geolocation API)
echo Detect\Detect::ipCountry();

// Get the name & version of operating system
echo Detect\Detect::os();

// Get the name & version of browser
echo Detect\Detect::browser();

// Detect\Detects if IE is version 9 or less & if it is, returns a warning:
// <strong>YOU ARE USING AN OUTDATED BROWSER</strong><br>It is limiting your experience.<br>Please upgrade your browser.
// Optionally, send html to be prepended or appended to warning
echo Detect\Detect::ieOld([$prependHTML = ''],[ $appendHTML = '']);

// Get the brand of device (only works with mobile devices otherwise return null)
echo Detect\Detect::brand();

// Check for a specific platform with the help of the magic methods:
if (Detect\Detect::isiOS()) {

}

if (Detect\Detect::isAndroidOS()) {

}

Copyright

Developed by Kevin Warren

Download of plain version under detectdevice.com

Detect Device is an open-source script released under MIT License

统计信息

  • 总下载量: 423
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-04-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固