How to get the phone model

Source: Internet
Author: User
Tags lenovo
How do I get my phone model?
I want to get the terminal model of the logged in user,
Make the following statistics.
I've tried the Moblie_detect class,
But there are not all types of mobile phones in this category, and no Xiaomi, Huawei and so on models,
I found my own and couldn't find the model of the specific phone.
I'm finally going to get the brand of the phone

------to solve the idea----------------------

$user _agent = $_server[' http_user_agent ');
if (Stripos ($user _agent, "IPhone")!==false) {
$brand = ' IPhone ';
} else if (Stripos ($user _agent, "SAMSUNG")!==false
------to solve the idea----------------------
Stripos ($user _agent, "Galaxy")!==false
------to solve the idea----------------------
Strpos ($user _agent, "gt-")!==false
------to solve the idea----------------------
Strpos ($user _agent, "sch-")!==false
------to solve the idea----------------------
Strpos ($user _agent, "sm-")!==false) {
$brand = ' Samsung ';
} else if (Stripos ($user _agent, "Huawei")!==false
------to solve the idea----------------------
Stripos ($user _agent, "Honor")!==false
------to solve the idea----------------------
Stripos ($user _agent, "h60-")!==false
------to solve the idea----------------------
Stripos ($user _agent, "h30-")!==false) {
$brand = ' Huawei ';
} else if (Stripos ($user _agent, "Lenovo")!==false) {
$brand = ' Lenovo ';
} else if (Strpos ($user _agent, "Mi-one")!==false
------to solve the idea----------------------
Strpos ($user _agent, "MI 1S")!==false
------to solve the idea----------------------
Strpos ($user _agent, "MI 2")!==false
------to solve the idea----------------------
Strpos ($user _agent, "MI 3")!==false
------to solve the idea----------------------
Strpos ($user _agent, "MI 4")!==false
------to solve the idea----------------------
Strpos ($user _agent, "MI-4")!==false) {
$brand = ' millet ';
} else if (Strpos ($user _agent, "HM NOTE")!==false
------to solve the idea----------------------
Strpos ($user _agent, "HM201")!==false) {
$brand = ' Red rice ';
} else if (Stripos ($user _agent, "Coolpad")!==false
------to solve the idea----------------------
Strpos ($user _agent, "8190Q")!==false
------to solve the idea----------------------
Strpos ($user _agent, "5910")!==false) {
$brand = ' Cool pie ';
} else if (Stripos ($user _agent, "ZTE")!==false
------to solve the idea----------------------
Stripos ($user _agent, "X9180")!==false
------to solve the idea----------------------
Stripos ($user _agent, "N9180")!==false
------to solve the idea----------------------
Stripos ($user _agent, "U9180")!==false) {
$brand = ' ZTE ';
} else if (Stripos ($user _agent, "OPPO")!==false
------to solve the idea----------------------
Strpos ($user _agent, "X9007")!==false
------to solve the idea----------------------
Strpos ($user _agent, "X907")!==false
------to solve the idea----------------------
Strpos ($user _agent, "X909")!==false
------to solve the idea----------------------
Strpos ($user _agent, "r831s")!==false
------to solve the idea----------------------
Strpos ($user _agent, "r827t")!==false
------to solve the idea----------------------
Strpos ($user _agent, "r821t")!==false
------to solve the idea----------------------
Strpos ($user _agent, "R811")!==false
------to solve the idea----------------------
Strpos ($user _agent, "R2017")!==false) {
$brand = ' OPPO ';
} else if (Strpos ($user _agent, "HTC")!==false
------to solve the idea----------------------
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 = ' Day language ';
} else if (Stripos ($user _agent, "Nubia")!==false
------to solve the idea----------------------
Stripos ($user _agent, "NX50")!==false
------to solve the idea----------------------
Stripos ($user _agent, "NX40")!==false) {
$brand = ' Nubian ';
} else if (Strpos ($user _agent, "M045")!==false
------to solve the idea----------------------
Strpos ($user _agent, "M032")!==false
------to solve the idea----------------------
Strpos ($user _agent, "M355")!==false) {
$brand = ' Meizu ';
} else if (Stripos ($user _agent, "Doov")!==false) {
$brand = ' blossoming ';
} else if (Stripos ($user _agent, "gfive")!==false) {
$brand = ' Kivu ';
} else if (Stripos ($user _agent, "Gionee")!==false
------to solve the idea----------------------
Strpos ($user _agent, "GN")!==false) {
$brand = ' Golden State ';
} else if (Stripos ($user _agent, "Hs-u")!==false
------to solve the idea----------------------
Stripos ($user _agent, "hs-e")!==false) {
$brand = ' Hisense ';
} else if (Stripos ($user _agent, "Nokia")!==false) {
$brand = ' Nokia ';
} else {
$brand = ' other phones ';
}
Echo $brand;
?>
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.