<?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. delete 与 delete []

    /* Module: delete与delete[]的区别.cpp Notices: Copyright (c) 2017 Landy Tan */ #include <iostream> ...

  2. ngnix——FastCGI 相关参数调优

    当 LNMP 组合工作时,首先是用户通过浏览器输入域名请求 Nginx Web 服务,如果请求的是静态资源,则由 Nginx 解析返回给用户:如果是动态请求(如 PHP),那么 Nginx 就会把它通 ...

  3. kettle在本地执行向远程hdfs执行转换错误"Couldn't open file hdfs"

    kettle在本地执行向远程hdfs执行转换时,会出现以下错误: ToHDFS.0 - ERROR (version 7.1.0.0-12, build 1 from 2017-05-16 17.18 ...

  4. Python全栈之路----函数----匿名函数

    用lambda声明匿名函数,对lambda定义名字,才能被调用.下面的calc和func功能一致. def calc(x,y): return x*y func = lambda x,y: x*y # ...

  5. 集群相关、用keepalived配置高可用集群

    1.集群相关 2.keepalived相关 3.用keepalived配置高可用集群 安装:yum install keepalived -y   高可用,主要是针对于服务器硬件或服务器上的应用服务而 ...

  6. MySQL:日期函数、时间函数总结(MySQL 5.X)

    http://www.cnblogs.com/she27/archive/2009/01/16/1377089.html 原文:http://www.51sdj.com/phpcms/picture/ ...

  7. C++对象的构造、析构与拷贝构造

    今天下午在研究虚函数的时候遇到了一个问题,觉得很有意思,记录一下. 先看代码: class Base { public: Base(int value) { m_nValue = value; cou ...

  8. 创建一个dynamics 365 CRM online plugin (三) - PostOperation

    上两节我们创建了一个 PreOperation的plugin 今天我们创建一个PostOpeartion的plugin和之前的plugin连接起来 当创建contact之后,我们要添加一个task给新 ...

  9. 回顾HashMap

    一.HashMap的原理简述 HashMap是基于哈希表的非线程安全的Map实现,内部采用数组+链表实现,其内部类Node定义了数据元素类型,它扩展了Map.Entry<K,V>增加了指向 ...

  10. py-day3-1 python 风湿理论之函数即变量

    # 风湿理论之函数即变量 def foo(): print('from foo') bar() def bar(): print('from bar') foo() from foo from bar ...