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 ...
随机推荐
- JS查看IOS手机的版本号
微信弹portal连接wifi的开发过程中,遇到了有些版本的ios系统在弹portal的浏览器(以下称小浏览器)中无法进行alert(),weixin://等等操作,只能使用window.locati ...
- Linux ssh命令详解
SSH(远程连接工具)连接原理:ssh服务是一个守护进程(demon),系统后台监听客户端的连接,ssh服务端的进程名为sshd,负责实时监听客户端的请求(IP 22端口),包括公共秘钥等交换等信息. ...
- pycharm 的调试模式 MAC版
进入调试模式 运行和调试快捷键 control +R 运行程序 control +alt +R 快速选择运行/调试配置并运行或编辑它 command +R 重新运行 control +R 重复执行相同 ...
- net start/stop mysql access denied.拒绝访问
转载:Mysql net start mysql启动,提示发生系统错误 5 拒绝访问 解决之道 为什么会出现这个问题呢?经过一番思考找到原因了,是因为当前用户的操作权限太低了,出了问题 出错问题截屏如 ...
- 【转载】 TensorflowOnSpark:1)Standalone集群初体验
原文地址: https://blog.csdn.net/jiangpeng59/article/details/72867368 作者:PJ-Javis 来源:CSDN --------------- ...
- Navicat For MySQL--外键建立与cannot add foreign key constraint分析
hrm_job.png 参考资料: https://blog.csdn.net/ytm15732625529/article/details/53729155 https://www.cnblogs. ...
- Python全栈之路----文件处理
文件操作分为读.写.修改,我们先从读开始 f = open(file = 'D:/工作日常/ABCD.txt',mode = 'r',encoding = 'utf-8') #file 是文件路径 m ...
- dp——完全背包(方案数)
Problem J. icebound 的商店Time limit: 1000msMemory limit: 65536KBDescriptionicebound 在得到神殿的宝藏之后,开了一家神秘的 ...
- linux_wget 使用
一.Linux之安装软件之wget安装方法使用 https://www.cnblogs.com/peida/archive/2013/03/18/2965369.html
- (拼接SQL语句)mysql中date类型,datetime类型
: , . _ - / % & # @ ! * | [ ] { } ; + = update ky set date = '18,9-2' where id = 1 // 2 ...