<?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. python基础——字典

    字典内置函数&方法 Python字典包含了以下内置函数: 序号 函数及描述 1 cmp(dict1, dict2)比较两个字典元素. 2 len(dict)计算字典元素个数,即键的总数. 3 ...

  2. Android:layout属性大全

    Android layout属性大全 第一类:属性值 true或者 false android:layout_centerHrizontal 水平居中android:layout_centerVert ...

  3. Fedora 23 U盘启动出现“Failed to load ldlinux.c32”解决 ZT

      利用UltraISO制作了Fedora 23的U盘启动,开机F12键USB启动时出现 1 2 Failed to load ldlinux.c32 Boot failed: please chan ...

  4. 1.2 pip降级selenium3.0

    1.2 pip降级selenium3.0 selenium版本安装后启动Firefox出现异常:'geckodriver' executable needs to be in PATHselenium ...

  5. 类Shiro权限校验框架的设计和实现

    前言: 之前简单集成了springmvc和shiro用于后台管理平台的权限控制, 设计思路非常的优美, 而且编程确实非常的方便和简洁. 唯一的不足, 我觉得配置稍有些繁琐. 当时我有个小想法, 觉得可 ...

  6. $inject

    function breadcrumb($parse, store) { } // 为了压缩 breadcrumb.$inject = ['$parse', 'breadcrumbStore']

  7. XML二

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

  8. 常见模块(二) logging模块

    logging模块是专门做日志系统的.分为函数版和自定义函数. (一)logging模块初级版 缺点,不能指定字符集,不能把屏幕输出和文件日志同时记录.只能选择其一. 文件记录日志 import lo ...

  9. arduino 522样本中文注释

    #accesscontrol访问控制#change uid更改UID#dump info转储信息#firmware_check固件#Fix Bricked UID修复变砖的UID#Mifare Cla ...

  10. 学习笔记TF038:实现估值网络

    Q-Learning,学习Action对应期望值(Expected Utility).1989年,Watkins提出.收敛性,1992年,Watkins和Dayan共同证明.学习期望价值,从当前一步到 ...