<?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. ES6新特性,对象的快速创建

    //es6对象快速赋值 //es5对象赋值 var name="xiaoming"; var age=18 var person={ name:name, age:age } co ...

  2. laravel 常用命令

    1.创建控制器 php artisan make:controller ArticleController // 带 restful 风格 php artisan make:controller Ar ...

  3. php 调用天气接口

    前几天没事的时候,浏览博客看到了一篇免费天气接口的文章,然后调用了一下文章中提到的接口,自己琢磨了半天,把数据处理了一下,虽然现在用不到,但是说不定以后会用,所以打算记录一下,毕竟这也算是自己第一次在 ...

  4. maven项目pom.xml第一行报错

    maven项目pom.xml第一行报错 这是第一行:<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi= ...

  5. Python全栈之路----常用模块----datetime模块详解

    相比于time模块,datetime模块的接口则更直观,更容易调用. datetime模块定义了下面这几个类: datetime.date:表示日期的类,常用的属性有year,month,day: d ...

  6. STL:unique()函数

    unique() unique()是剔除重复他是剔除相邻之间字符重复的,倘若其中中的字符前后之间是没有重复的,unique函数是起不到作用的,所以使用以前都会sort处理. unique()函数的返回 ...

  7. svn安装时遇到问题总结

    问题1: 一番折腾终于解决了,现将解决方法总结一下: 1.点击Window键+R键,如下图: 2.输入services.msc命令,然后点击“确定”,得到下图: 3.找到并选中“Windows Man ...

  8. Kali安装虚拟机遇到的问题

    1.上官网下载了最新版的VMware 14.0版,安装的时候下一步下一步就是了. 2.最新版的官网激活码 FF590-2DX83-M81LZ-XDM7E-MKUT4 CG54H-D8D0H-H8DHY ...

  9. 第三节《Git重置》

    先来看看.git/refs/heads/master文件的内容 [root@git demo]# cat .git/refs/heads/master e97f443b2d1cee7eeca7dc2e ...

  10. exec 与文件描述符

    参考http://blog.csdn.net/baoendemao/article/details/51638746 1:用法       exec 3<2.txt  以只读方式打开2.txt, ...