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 ...
随机推荐
- effective java——30使用enum
1, 枚举太阳系八大行星 package com.enum30.www; public enum Planet {//枚举太阳系八大行星 MERCURY(3.302e+23,2.439e6), VEN ...
- nodejs --- formidable模块 , post 上传.
1. 只有一个文件域: var formidable = require('formidable'), http = require('http'), util = require('util'); ...
- 说说VBA中的面向对象
对象是 Visual Basic 的结构基础,在 Visual Basic 中进行的所有操作几乎都与修改对象有关.Microsoft Word 的任何元素,如文档.表格.段落.书签.域等,都可用 Vi ...
- leetcode题解2. Add Two Numbers
题目: You are given two non-empty linked lists representing two non-negative integers. The digits are ...
- Tex_Err:缺失wlscirep.cls
使用期刊模板编译时,需要'.cls'一类格式文件支持.从Overleaf上直接Copy代码到本地,发现自己的tex运行时会报错: ! LaTeX Error: File `wlscirep.cls' ...
- 在Power BI报表和仪表板中显示刷新日期\时间
有人最近问我:“如何在报告和仪表板中显示最后刷新数据的日期和时间?”这里有两个简单的技巧在这分享下,也许可以帮助到你. 显示上次刷新日期\时间 要想显示刷新的日期和时间,我们需要在模型本身中存储时间刷 ...
- Scrapy、Scrapy-redis组件
目录 Scrapy 一.安装 二.基本使用 1. 基本命令 2.项目结构以及爬虫应用简介 3. 小试牛刀 4. 选择器 5. 格式化处理 6.中间件 7. 自定制命令 8. 自定义扩展 9. 避免重复 ...
- python import 包的路径以及相对路径加载的问题
查看python当前系统import 命令时,系统支持的路径 除了当前目录之外,如下代码 即可查看import 包含的路径在哪些地方 参考链接 https://www.cnblogs.com/qing ...
- Cocos2dx利用intersectsRect函数检测碰撞
if (sp1->boundingBox().intersectsRect(sp2->boundingBox())) { pLabel->setString(“碰撞飞机爆炸”); } ...
- 学会Git玩转GitHub全
我这个笔记是利用HTML5来写的,所以我现附上代码以及并上照片: 当下@future 2019/4/29 19:55:33 <!DOCTYPE html><html> < ...