<?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获取手机型号的更多相关文章

  1. android如何获取手机型号和版本号

    public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView ...

  2. 史上最简单,js并获取手机型号

    原先获取不了苹果系列的型号,但转换思路,先推断是否是苹果,再用分辨率获取型号 //获取手机型号函数begin function getPhoneType(){  //正则,忽略大写和小写 var pa ...

  3. 前端通过js获取手机型号

    ###前段通过js获取手机型号 需求: 用户登录后记录当前的手机型号并记录 插件: mobile-detect.js插件地址 mobile-device-js插件地址 使用步骤: 获取UA信息-> ...

  4. JS获取手机型号和系统

    废话不多说,直接上源码 <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type&q ...

  5. iOS获取手机型号,类似iphone 7这种 含swift和OC

    获取手机设备信息,如name.model.version等,但如果想获取具体的手机型号,如iphone5.5s这种,就需要如下这种 swift: func phonetype () -> Str ...

  6. android 获取手机型号,本机电话号码,SDK版本以及firmwarw版本号(即系统版本号)

    Android开发平台中,可通过TelephonyManager 获取本机号码. TelephonyManager phoneMgr=(TelephonyManager)this.getSystemS ...

  7. iOS获取手机型号,Swift获取手机型号(类似iphone 7这种,检测机型具体型号)

    获取手机设备信息,如name.model.version等, 但如果想获取具体的手机型号,如iphone5.5s这种,就需要如下这种(含Swift和OC两种写法) Swift建议添加到extensio ...

  8. iOS获取手机型号、iOS获取当前app的名称和版本号

    NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; CFShow(infoDictionary); // ap ...

  9. Android编程获取手机型号,本机电话号码,sdk版本号及firmware版本号号(即系统版本号号)

    Android开发平台中,可通过TelephonyManager 获取本机号码. TelephonyManager phoneMgr=(TelephonyManager)this.getSystemS ...

  10. Android 获取imei号码,获取手机型号和系统版本号

    在AndroidManifest.xml文件中要添加 <uses-permission android:name="android.permission.READ_PHONE_STAT ...

随机推荐

  1. 第一节课:java介绍以及java开发环境的安装

    互联网时代 什么是软件 什么是硬件 什么是操作系统 java是什么? 计算机高级程序语言 java能做什么? 开发软件(网站.app.游戏.应用系统.嵌入式) java对应的职位链(需求->产品 ...

  2. admin 后台

    https://segmentfault.com/a/1190000015835976#articleHeader3https://github.com/PanJiaChen/vue-element- ...

  3. 18-11-01 pandas 学习03

    [python]pandas display选项 import pandas as pd 1.pd.set_option('expand_frame_repr', False) True就是可以换行显 ...

  4. asp.net 网页跳转的几种常用方法

    Response.Redirect("http://www.baidu.com",false); 后面的bool值为是否停止执行当前页.跳转向新的页面,原窗口被代替.浏览器中的UR ...

  5. mysql date

    date_format(`time`, '%Y-%m-%d %h:%i:%s' ) as time

  6. 使用selenium爬取网站动态数据

    处理页面动态加载的爬取 selenium selenium是python的一个第三方库,可以实现让浏览器完成自动化的操作,比如说点击按钮拖动滚轮等 环境搭建: 安装:pip install selen ...

  7. XML二

    XML的语法要求: 1,XML文档必须有一个顶层元素,即文档元素,所有其他元素必须嵌入在文档元素中. 2,元素嵌套要正确,即如果一个元素在另一个元素中开始,那么必须在同一个元素中结束. 3,每个元素必 ...

  8. centos安装redis步骤

    1.官网或wget下载redis-4.0.9.tar.gz: cd /home/tar wget http://download.redis.io/releases/redis-4.0.9.tar.g ...

  9. extjs_10_自己定义combotree组件

    1.项目截图 2.treedata.json { text : "root", expanded : true, expandable : true, children : [{ ...

  10. Java 的 volatile 修饰符

    volatile 修饰符,用于多线程同步 volatile 修饰的成员变量在每次被线程访问时,都强制从共享内存中重新读取该成员变量的值.而且,当成员变量发生变化时,会强制线程将变化值回写到共享内存.这 ...