PHP获取手机型号
<?php
$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
=
'其他手机'
;
}
echo
$brand
;
?>
PHP获取手机型号的更多相关文章
- android如何获取手机型号和版本号
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView ...
- 史上最简单,js并获取手机型号
原先获取不了苹果系列的型号,但转换思路,先推断是否是苹果,再用分辨率获取型号 //获取手机型号函数begin function getPhoneType(){ //正则,忽略大写和小写 var pa ...
- 前端通过js获取手机型号
###前段通过js获取手机型号 需求: 用户登录后记录当前的手机型号并记录 插件: mobile-detect.js插件地址 mobile-device-js插件地址 使用步骤: 获取UA信息-> ...
- JS获取手机型号和系统
废话不多说,直接上源码 <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type&q ...
- iOS获取手机型号,类似iphone 7这种 含swift和OC
获取手机设备信息,如name.model.version等,但如果想获取具体的手机型号,如iphone5.5s这种,就需要如下这种 swift: func phonetype () -> Str ...
- android 获取手机型号,本机电话号码,SDK版本以及firmwarw版本号(即系统版本号)
Android开发平台中,可通过TelephonyManager 获取本机号码. TelephonyManager phoneMgr=(TelephonyManager)this.getSystemS ...
- iOS获取手机型号,Swift获取手机型号(类似iphone 7这种,检测机型具体型号)
获取手机设备信息,如name.model.version等, 但如果想获取具体的手机型号,如iphone5.5s这种,就需要如下这种(含Swift和OC两种写法) Swift建议添加到extensio ...
- iOS获取手机型号、iOS获取当前app的名称和版本号
NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; CFShow(infoDictionary); // ap ...
- Android编程获取手机型号,本机电话号码,sdk版本号及firmware版本号号(即系统版本号号)
Android开发平台中,可通过TelephonyManager 获取本机号码. TelephonyManager phoneMgr=(TelephonyManager)this.getSystemS ...
- Android 获取imei号码,获取手机型号和系统版本号
在AndroidManifest.xml文件中要添加 <uses-permission android:name="android.permission.READ_PHONE_STAT ...
随机推荐
- python自学第7天,函数,参数
函数:逻辑结构化和过程化的一种编程方法 面向对象--->类 class 面向过程--->过程 def 函数编程--->函数def import time def logger(): ...
- linq的基本使用
1.查询所有的偶数 , , , , , , , , , , , , }; var elist = from s in str == select s; foreach (int i in elist) ...
- Page 对象详解
Page 对象 由于网页编译后所创建的类由Page派生而来,因此网页可以直接使用Page对象的属性.方法和事件. Page对象的常用属性 1.IsPostBack(bool类型) 获取一个值,该值指示 ...
- 【SpringData学习】
1.注解@Modifying 在springData中,大部分给出的接口都是查询的,那要进行删除和更新的时候,大部分都需要使用@Query 进行手写代码.并且需要使用@Modifying注解. 使用场 ...
- Spring Data JPA 常用注解 @Query、@NamedQuery
1.@Transient @Transient表示该属性并非一个到数据库表的字段的映射,ORM框架将忽略该属性:如果一个属性并非数据库表的字段映射,就务必将其标示为@Transient,否则ORM框架 ...
- Windows下运行Linux命令
安装Gow软件,Gow-0.7.0.exe,这样就可以在Windows命令行运行Linux命令,比如通过scp把Windows下的文件拷贝到Linux下. 直接运行安装,不会生成任何客户端,直接使用W ...
- 转"container of()函数简介"链接地址
https://blog.csdn.net/s2603898260/article/details/79371024 提示关键字: 指针0的使用 typeof的使用
- python socket 函数介绍
socket 函数原型:socket.socket([family[,type[,proto]]]) family参数取值(协议族): socket.AF_INET -->ipv4 ...
- Linux中“零拷贝”
服务器响应一个http请求的步骤 把磁盘文件读入内核缓冲区 从内核缓冲区读到内存 处理(静态资源不需处理) 发送到网卡的内核缓冲区(发送缓存) 网卡发送数据 数据从第一步中的内核缓冲区到第四步的内核缓 ...
- ubuntu拒绝root用户ssh远程登录解决办法
ubuntu拒绝root ssh远程登录通常情况是ssh设置了禁止root远程登录,解决办法就是:修改ssh配置,然后重启ssh服务即可. vi /etc/ssh/sshd_config 找到并用#注 ...