技术标签: php
//版本
public function getOS()
{
$ua = $_SERVER['HTTP_USER_AGENT'];
if (strpos($ua, 'Android') !== false) {
preg_match("/(?<=Android )[\d\.]{1,}/", $ua, $version);
return 'Platform:Android OS_Version:'.$version[0];
} elseif (strpos($ua, 'iPhone') !== false) {
preg_match("/(?<=CPU iPhone OS )[\d\_]{1,}/", $ua, $version);
return 'Platform:iPhone OS_Version:'.str_replace('_', '.', $version[0]);
} elseif (strpos($ua, 'iPad') !== false) {
preg_match("/(?<=CPU OS )[\d\_]{1,}/", $ua, $version);
return 'Platform:iPad OS_Version:'.str_replace('_', '.', $version[0]);
}
}
//型号
public function mobile_type()
{
$user_agent = $_SERVER['HTTP_USER_AGENT'];
if (stripos($user_agent, "iPhone")!==false) {
$brand = 'iPhone';
} else if (stripos($user_agent, "SAMSUNG")!==false || stripos($user_agent, "Galaxy")!==false || strpos($user_agent, "GT-")!==false || strpos($user_agent, "SCH-")!==false || strpos($user_agent, "SM-")!==false) {
$brand = '三星';
} else if (stripos($user_agent, "Huawei")!==false || stripos($user_agent, "Honor")!==false || stripos($user_agent, "H60-")!==false || stripos($user_agent, "H30-")!==false) {
$brand = '华为';
} else if (stripos($user_agent, "Lenovo")!==false) {
$brand = '联想';
} else if (strpos($user_agent, "MI-ONE")!==false || strpos($user_agent, "MI 1S")!==false || strpos($user_agent, "MI 2")!==false || strpos($user_agent, "MI 3")!==false || strpos($user_agent, "MI 4")!==false || strpos($user_agent, "MI-4")!==false) {
$brand = '小米';
} else if (strpos($user_agent, "HM NOTE")!==false || strpos($user_agent, "HM201")!==false) {
$brand = '红米';
} else if (stripos($user_agent, "Coolpad")!==false || strpos($user_agent, "8190Q")!==false || strpos($user_agent, "5910")!==false) {
$brand = '酷派';
} else if (stripos($user_agent, "ZTE")!==false || stripos($user_agent, "X9180")!==false || stripos($user_agent, "N9180")!==false || stripos($user_agent, "U9180")!==false) {
$brand = '中兴';
} else if (stripos($user_agent, "OPPO")!==false || strpos($user_agent, "X9007")!==false || strpos($user_agent, "X907")!==false || strpos($user_agent, "X909")!==false || strpos($user_agent, "R831S")!==false || strpos($user_agent, "R827T")!==false || strpos($user_agent, "R821T")!==false || strpos($user_agent, "R811")!==false || strpos($user_agent, "R2017")!==false) {
$brand = 'OPPO';
} else if (strpos($user_agent, "HTC")!==false || stripos($user_agent, "Desire")!==false) {
$brand = 'HTC';
} else if (stripos($user_agent, "vivo")!==false) {
$brand = 'vivo';
} else if (stripos($user_agent, "K-Touch")!==false) {
$brand = '天语';
} else if (stripos($user_agent, "Nubia")!==false || stripos($user_agent, "NX50")!==false || stripos($user_agent, "NX40")!==false) {
$brand = '努比亚';
} else if (strpos($user_agent, "M045")!==false || strpos($user_agent, "M032")!==false || strpos($user_agent, "M355")!==false) {
$brand = '魅族';
} else if (stripos($user_agent, "DOOV")!==false) {
$brand = '朵唯';
} else if (stripos($user_agent, "GFIVE")!==false) {
$brand = '基伍';
} else if (stripos($user_agent, "Gionee")!==false || strpos($user_agent, "GN")!==false) {
$brand = '金立';
} else if (stripos($user_agent, "HS-U")!==false || stripos($user_agent, "HS-E")!==false) {
$brand = '海信';
} else if (stripos($user_agent, "Nokia")!==false) {
$brand = '诺基亚';
} else {
$brand = '其他手机';
}
return $brand;
}
文章浏览阅读584次。http://www.cnblogs.com/skyfsm/p/6894685.html 详解掩膜mask 理解:我要对一幅图像进行抠图操作,就要用到mask#include "opencv2/highgui/highgui.hpp"#include "opencv2/imgproc/imgproc.hpp"#include #include using nam_mask[140:150,710:640]
文章浏览阅读110次。一、maven介绍Maven项目对象模型(POM),可以通过一小段描述信息来管理项目的构建,是报告和文档的项目管理工具软件。依赖管理:管理jar项目构建:POM(Project Object Model) 项目对象模型官网:https://maven.apache.org中文意思:专家、内行主要功能构造工程管理jar包编译代码单元测试打包项目部署项目二、搭建环境下..._com.konghq maven
文章浏览阅读728次。文章目录k8s部署单节点配置k8s群集及docker通信制作证书过程ETCD 二进制包地址配置文件,命令文件,证书目录在node01和node02节点配置ETCDdocker引擎部署flannel网络配置flannel网络配置master节点配置3大控制主键制作证书过程配置kubernetestocken令牌认证node节点部署node02节点部署k8s部署单节点配置k8s群集及docker通信制作证书过程master操作[root@localhost ~]# mkdir k8s[root@lo_k8 etcd容器安装在node节点上
文章浏览阅读1k次。TensorFlow是一种基于数据流编程的开源软件库,是人工智能领域中的重要工具,广泛应用于深度学习、自然语言处理等领域。_tensorflow应用
文章浏览阅读196次。为了让应用更快接入,腾讯提供了JS SDK。 JS SDK是现有最简单的接入QQ互联的方式。JS SDK基于QQ互联OAuth2.0协议的client-side模式, 封装了登录流程与【QQ登录】API列表中的所有OpenAPI调用方法。开发者不需了解协议,只需要前台交互,以及将相关的参数修改成自身对应的参数即可使用。 同时,QQ互联又提供了可供第三方高级需求进行自行配置的可选参数与相关..._qclogin_success
文章浏览阅读1.9k次。随着我国城市化速度的加快以及城市规模的不断扩大,交通供需矛盾日益突出,在城市交通网络中产生的交通拥堵现象日趋严重,严重影响了社会经济的发展和人民生活水平的提高。为了提高城市道路交通管理水平,改善城市交通秩序,保障公路交通的畅通与安全,当今世界各国普遍使用智能交通系统。在该系统中,核心的问题是交通信号智能控制。平面交叉口是道路交通的主要冲突点,不仅机动车数量多,而且行人和非机动车也在同一平面通过。目前在我国的大、中型城市交通管理中,普遍采用的是单点定时交通信号灯控制。_交通配时代码
文章浏览阅读1.5k次。转自:https://www.extlight.com/2018/01/26/Spring-Boot-%E5%85%A5%E9%97%A8%E4%B9%8B%E6%B6%88%E6%81%AF%E4%B8%AD%E9%97%B4%E4%BB%B6%E7%AF%87%EF%BC%88%E4%BA%94%EF%BC%89/Spring Boot 入门之消息中间件篇(五) 发表于2018-01-26 |..._springbootfrom 'file:/d:/%e5%85%ac%e5%8f%b8%e9%a1%b9%e7%9b%ae/demoviabim/tar
文章浏览阅读1.8w次,点赞3次,收藏6次。javascript下载Unlike other languages that can be used in a web browser, JavaScript doesn't need to be downloaded and installed. Browsers that support JavaScript have it built into the browser, where it..._javascript下载官网
文章浏览阅读3.8k次。1 mmap总是报错:“Operation not permitted”2 mmap还是返回错误:“Invalid argument”。( or EINVAL)3 Solution:4 (to solve issue 1)在.config文件中设置CONFIG_STRICT_DEVMEM is not set5 (to solve issue 2)在.confi_devmem mmap:operation not permitted
文章浏览阅读717次。edu.51cto.com/sd/4920aHC-SR04传感器引脚由4个:VCC,GND,发射,echo, RPi和超声波传感器这样连接:连接传感器VCC引脚到引脚4 连接传感器GND引脚到引脚9 连接传感器Trig引脚到wiringPi引脚12传感器echo引脚经过分压器后连接到wiringPi引脚13。分压器电路的两个电阻分别是1KΩ和2KΩ。分压器电路用于把输入的5V信号降低到3.3V,避免烧坏主板,它是从echo引脚到RPi如下图:用于把输入电压转为3.3V的公式:._超声波传感器避障算法 c++
文章浏览阅读2.3k次。7.执行安装,如提示success即安装成功。其它错误请拍照发给我看。5.在最后输入adb所在完整路径,前面加上分好;_adb install 安装apk
文章浏览阅读10w+次,点赞167次,收藏1.5k次。十三个经典算法研究与总结、目录+索引「后续更新为十五个」 (PDF下载地址:http://download.csdn.net/detail/v_july_v/4478027)作者:July。时间:二零一零年十二月末-二零一一年四月初。出处:http://blog.csdn.net/v_JULY_v。声明:版权所有,侵权定究。------------------------------_经典算法