Hướng dẫn php user agent parser - trình phân tích cú pháp tác nhân người dùng php

Dưới đây là 15 kho lưu trữ công cộng phù hợp với chủ đề này ...

Hướng dẫn php user agent parser - trình phân tích cú pháp tác nhân người dùng php
  • Mã số
  • Vấn đề
  • Kéo yêu cầu

Phát hiện trình duyệt cho Laravel bởi Hisorange!

  • Cập nhật ngày 12 tháng 10 năm 2022
  • PHP

  • Mã số
  • Vấn đề
  • Kéo yêu cầu

Phát hiện trình duyệt cho Laravel bởi Hisorange!

  • Cập nhật ngày 12 tháng 10 năm 2022
  • PHP

  • Mã số
  • Vấn đề
  • Kéo yêu cầu

Phát hiện trình duyệt cho Laravel bởi Hisorange!

Cập nhật ngày 12 tháng 10 năm 2022

  • PHP
  • PHP

  • Mã số
  • Vấn đề
  • Kéo yêu cầu

Phát hiện trình duyệt cho Laravel bởi Hisorange!

  • Cập nhật ngày 12 tháng 10 năm 2022
  • PHP

  • Mã số
  • Vấn đề
  • Kéo yêu cầu

  • Phát hiện trình duyệt cho Laravel bởi Hisorange!
  • PHP

  • Mã số
  • Vấn đề
  • Kéo yêu cầu

Lightning nhanh, phân tích cú pháp chuỗi người dùng PHP tối giản.

  • Cập nhật ngày 8 tháng 8 năm 2022
  • PHP

  • Mã số
  • Vấn đề
  • Kéo yêu cầu
  • Lightning nhanh, phân tích cú pháp chuỗi người dùng PHP tối giản.

Cập nhật ngày 8 tháng 8 năm 2022

  • 📃
  • PHP

  • Mã số
  • Vấn đề
  • Kéo yêu cầu

Lightning nhanh, phân tích cú pháp chuỗi người dùng PHP tối giản.

  • Cập nhật ngày 8 tháng 8 năm 2022
  • PHP

  • Mã số
  • Vấn đề
  • Kéo yêu cầu

Lightning nhanh, phân tích cú pháp chuỗi người dùng PHP tối giản.

  • Cập nhật ngày 8 tháng 8 năm 2022
  • PHP

  • Mã số
  • Vấn đề
  • Kéo yêu cầu

Lightning nhanh, phân tích cú pháp chuỗi người dùng PHP tối giản.

  • Cập nhật ngày 8 tháng 8 năm 2022
  • PHP

  • Mã số
  • Vấn đề
  • Kéo yêu cầu

Cập nhật ngày 8 tháng 8 năm 2022

  • 📃
  • PHP

  • Mã số
  • Vấn đề
  • Kéo yêu cầu

  • Kho lưu trữ dự án chính
  • PHP

  • Mã số
  • Vấn đề
  • Kéo yêu cầu

Cập nhật ngày 27 tháng 10 năm 2022

  • Thư viện cho Php 7.4+ để phát hiện trình duyệt và thiết bị
  • PHP

  • Mã số
  • Vấn đề
  • Kéo yêu cầu

Cập nhật ngày 23 tháng 3 năm 2022

  • Cập nhật ngày 21 tháng 9 năm 2022
  • PHP

  • Mã số
  • Vấn đề
  • Kéo yêu cầu

Tích hợp Laravel với gói DeviceDetector của Piwik.

  • Cập nhật ngày 30 tháng 12 năm 2018
  • PHP

Thảo luận

Tập lệnh PHP để phát hiện chi tiết trình duyệtuser-agent-parser topic page so that developers can more easily learn about it.

Cập nhật ngày 12 tháng 9 năm 2021

Ứng dụng để so sánh và điểm chuẩn của thư viện phân tích cú pháp UserAgent

Cập nhật ngày 28 tháng 11 năm 2021user-agent-parser topic, visit your repo's landing page and select "manage topics."

Trình phân tích cú pháp người dùng PHP đơn giản

Đây là một thư viện đánh hơi trình duyệt cực kỳ phức tạp và gần như hoàn toàn vô dụng. Vô dụng vì bạn không nên sử dụng trình duyệt đánh hơi. Vì vậy, hãy dừng lại ngay bây giờ và đi đọc một cái gì đó về phát hiện tính năng thay thế. Tôi nghiêm túc. Đi chỗ khác. Bạn sẽ cảm ơn tôi sau.

WhichBrowser/Parser-PHP

Phiên bản PHP của whatbrowser để sử dụng trên máy chủ. Hoàn toàn tương thích với PHP 7.0 trở lên, bao gồm Php 8.

Hướng dẫn php user agent parser - trình phân tích cú pháp tác nhân người dùng php

Cũng có sẵn:

  • Whitbrowser/Parser-JavaScript Một phiên bản JavaScript của WHATBROWSER để sử dụng với Node.js trên máy chủ
    A JavaScript version of WhichBrowser for use with Node.js on the server

  • Whatbrowser/Server Một máy chủ được viết bằng PHP cung cấp API JavaScript để sử dụng trong trình duyệt
    A server written in PHP that provides a JavaScript API for use in the browser


Về whatbrowser

Nhưng tại sao gần như hoàn toàn vô dụng và không hoàn toàn vô dụng? Vâng, luôn có một ngoại lệ cho quy tắc. Có những lý do hợp lệ để thực hiện đánh hơi trình duyệt: để cải thiện trải nghiệm người dùng hoặc thu thập thông tin thông tin về trình duyệt nào được sử dụng trên trang web của bạn. Trang web của tôi là html5test.com và tôi muốn biết điểm nào thuộc về trình duyệt nào. Và để làm điều đó, bạn cần một thư viện đánh hơi trình duyệt. Well, there is always an exception to the rule. There are valid reasons to do browser sniffing: to improve the user experience or to gather intelligence about which browsers are used on your website. My website is html5test.com and I wanted to know which score belongs to which browser. And to do that you need a browser sniffing library.

Tại sao nó cực kỳ phức tạp? Bởi vì mọi người đều nói dối. Nghiêm túc mà nói, không có một trình duyệt nào hoàn toàn trung thực. Hầu như tất cả các trình duyệt nói rằng chúng là Netscape 5 và hầu hết tất cả các trình duyệt WebKit nói rằng chúng dựa trên tắc kè. Ngay cả Internet Explorer 11 bây giờ không còn tuyên bố là IE, mà thay vào đó là một trình duyệt không tên giống như Gecko. Và nó trở nên tồi tệ hơn. Đó là lý do tại sao nó phức tạp.
Because everybody lies. Seriously, there is not a single browser that is completely truthful. Almost all browsers say they are Netscape 5 and almost all WebKit browsers say they are based on Gecko. Even Internet Explorer 11 now no longer claims to be IE at all, but instead an unnamed browser that is like Gecko. And it gets worse. That is why it is complicated.

Nó cung cấp loại thông tin nào? Bạn nhận được một đối tượng đẹp có thông tin về trình duyệt, công cụ kết xuất, hệ điều hành và thiết bị. Nó cung cấp cho bạn tên và phiên bản và thậm chí nhà sản xuất và mô hình thiết bị. Và whatbrowser khá ngoan cường. Nó cung cấp cho bạn thông tin mà những người khác không. Ví dụ: You get a nice object which has information about the browser, rendering engine, os and device. It gives you names and versions and even device manufacturer and model. And WhichBrowser is pretty tenacious. It gives you info that others don't. For example:

JUC (Linux; U; 2.3.6; zh-cn; GT-I8150; 480*800) UCWEB8.7.4.225/145/800  
UC Browser 8.7 on a Samsung Galaxy W running Android 2.3.6

Android không bao giờ được đề cập

Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform

Mặc dù tiêu đề Useragent tự xưng là một thiết bị series40, chúng tôi biết rằng nó thực sự đang chạy nền tảng ASHA và chúng tôi cũng biết rằng Ovibrowser đã được đổi tên thành Nokia Xpress.

Opera/9.80 (X11; Linux zvav; U; zh) Presto/2.8.119 Version/11.10  
Opera Mini on a Nokia 5230 running Series60 5.0

Tiêu đề Useragent trông giống như Opera 11.10 trên Linux, nhưng chúng tôi biết đó là Opera Mini. Chúng tôi thậm chí có thể tìm ra mô hình hệ điều hành và thiết bị thực sự từ các tiêu đề khác.

Yêu cầu

Whatbrowser yêu cầu với PHP 7.0 trở lên và hỗ trợ PHP 8. WHITBROWSER tương thích với tiêu chuẩn tự động tải PSR-4 và theo kiểu mã hóa PSR-1 và PSR-2.

Cách cài đặt nó

Bạn có thể cài đặt whatbrowser bằng cách sử dụng trình soạn thảo - Trình quản lý gói tiêu chuẩn cho PHP. Gói được gọi là

Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform
8.

composer require whichbrowser/parser

Bạn có thể dễ dàng cập nhật whatbrowser bằng cách chạy một lệnh đơn giản.

composer update whichbrowser/parser

Bạn nên chạy lệnh này thường xuyên nhất có thể. Bạn thậm chí có thể muốn xem xét việc thiết lập một công việc cron cho mục đích này.

Làm thế nào để sử dụng nó

Bước đầu tiên yêu cầu trình tải tự động của nhà soạn nhạc:



    require 'vendor/autoload.php';

Bước thứ hai là tạo một đối tượng

Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform
9 mới. Đối tượng này sẽ chứa tất cả thông tin mà thư viện có thể tìm thấy về trình duyệt. Đối tượng có một tham số cần thiết, các tiêu đề được gửi bởi trình duyệt hoặc chuỗi người dùng. Sử dụng các tiêu đề là thích hợp hơn, vì nó sẽ cho phép phát hiện tốt hơn, nhưng nếu bạn chỉ có chuỗi người dùng, điều này cũng sẽ hoạt động.

Ví dụ:

$result = new WhichBrowser\Parser(getallheaders());

or:

$result = new WhichBrowser\Parser($_SERVER['HTTP_USER_AGENT']);

Biến

Opera/9.80 (X11; Linux zvav; U; zh) Presto/2.8.119 Version/11.10  
Opera Mini on a Nokia 5230 running Series60 5.0
0 hiện chứa một đối tượng mà bạn có thể truy vấn để biết thông tin. Có nhiều cách khác nhau để truy cập thông tin.

Trước hết, bạn có thể gọi đến chức năng

Opera/9.80 (X11; Linux zvav; U; zh) Presto/2.8.119 Version/11.10  
Opera Mini on a Nokia 5230 running Series60 5.0
1 để nhận được nhận dạng người có thể đọc được:

"You are using " . $result->toString();
// You are using Chrome 27 on OS X Mountain Lion 10.8

Một khả năng khác là truy vấn đối tượng:

$result->isType('desktop');
// true

$result->isType('mobile', 'tablet', 'media', 'gaming:portable');
// false

$result->isBrowser('Maxthon', '<', '4.0.5');
// false

$result->isOs('iOS', '>=', '8');
// false

$result->isOs('OS X');
// true

$result->isEngine('Blink');
// true

Bạn cũng có thể truy cập trực tiếp các thuộc tính này:

Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform
0

Hoặc truy cập trực tiếp các phần của các thuộc tính này:

Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform
1

Cuối cùng bạn cũng có thể truy vấn các phiên bản trực tiếp:

Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform
2

Tùy chọn

Có thể đặt các tùy chọn bổ sung bằng cách chuyển một mảng làm tham số thứ hai khi tạo đối tượng

Opera/9.80 (X11; Linux zvav; U; zh) Presto/2.8.119 Version/11.10  
Opera Mini on a Nokia 5230 running Series60 5.0
2.

Vô hiệu hóa phát hiện bot

Trong một số trường hợp, bạn có thể muốn vô hiệu hóa việc phát hiện bot. Điều này cho phép bot người cố tình đánh lừa whatbrowser, vì vậy bạn có thể chọn danh tính của người dùng những gì bot cố gắng bắt chước. Điều này đặc biệt tiện dụng khi bạn muốn sử dụng whatbrowser để chuyển đổi giữa các biến thể khác nhau của trang web của bạn và muốn đảm bảo các trình thu thập thông tin xem biến thể phù hợp của trang web. Ví dụ: một bot bắt chước một thiết bị di động sẽ thấy biến thể di động của trang web của bạn.

Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform
3

Bật bộ nhớ đệm kết quả

WhatBrowser hỗ trợ các bộ điều hợp bộ đệm tương thích PSR-6 để lưu trữ kết quả giữa các yêu cầu. Sử dụng bộ nhớ cache đặc biệt hữu ích nếu bạn sử dụng whatbrowser trên mỗi trang của trang web của bạn và người dùng truy cập nhiều trang. Trong chuyến thăm đầu tiên, các tiêu đề sẽ được phân tích cú pháp và kết quả sẽ được lưu trữ. Khi các chuyến thăm tiếp theo, kết quả được lưu trong bộ nhớ cache sẽ được sử dụng, nhanh hơn nhiều so với việc phải phân tích các tiêu đề nhiều lần.

Có những bộ điều hợp có sẵn cho các loại bộ nhớ cache khác, chẳng hạn như APC, Học thuyết, Memcached, MongoDB, Redis và nhiều hơn nữa. Cấu hình của các bộ điều hợp này đều khác nhau, nhưng sau khi được cấu hình, tất cả những gì bạn phải làm là truyền nó như một tùy chọn khi tạo đối tượng

Opera/9.80 (X11; Linux zvav; U; zh) Presto/2.8.119 Version/11.10  
Opera Mini on a Nokia 5230 running Series60 5.0
2 hoặc sử dụng hàm
Opera/9.80 (X11; Linux zvav; U; zh) Presto/2.8.119 Version/11.10  
Opera Mini on a Nokia 5230 running Series60 5.0
4 để đặt nó sau đó. Whatbrowser đã được thử nghiệm để làm việc với các bộ điều hợp được cung cấp bởi bộ đệm PHP. Đối với một danh sách các gói khác cung cấp bộ điều hợp, hãy xem Packagist.

Ví dụ: nếu bạn muốn bật bộ đệm dựa trên memcached, bạn cần cài đặt gói Composer bổ sung:

Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform
4

Và thay đổi cuộc gọi thành whatbrowser/trình phân tích cú pháp như sau:

Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform
5

hoặc

Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform
6

Bạn cũng có thể chỉ định sau bao nhiêu giây, một kết quả được lưu trong bộ nhớ cache nên được loại bỏ. Giá trị mặc định là 900 giây hoặc 15 phút. Nếu bạn nghĩ rằng whatbrowser sử dụng quá nhiều bộ nhớ để lưu trữ, bạn nên giảm giá trị này. Bạn có thể làm điều này bằng cách đặt tùy chọn

Opera/9.80 (X11; Linux zvav; U; zh) Presto/2.8.119 Version/11.10  
Opera Mini on a Nokia 5230 running Series60 5.0
5 hoặc chuyển nó dưới dạng tham số thứ hai cho hàm
Opera/9.80 (X11; Linux zvav; U; zh) Presto/2.8.119 Version/11.10  
Opera Mini on a Nokia 5230 running Series60 5.0
4.

Tham khảo API

Đối tượng phân tích cú pháp

Sau khi một đối tượng

Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform
9 mới được tạo, nó chứa một số thuộc tính và chức năng. Tất cả các tính chất này được đảm bảo sẽ có mặt.

Properties:

  • Opera/9.80 (X11; Linux zvav; U; zh) Presto/2.8.119 Version/11.10  
    Opera Mini on a Nokia 5230 running Series60 5.0
    
    8 Một đối tượng chứa thông tin về chính trình duyệt
    an object that contains information about the browser itself
  • Opera/9.80 (X11; Linux zvav; U; zh) Presto/2.8.119 Version/11.10  
    Opera Mini on a Nokia 5230 running Series60 5.0
    
    9 Một đối tượng chứa thông tin về công cụ kết xuất
    an object that contains information about the rendering engine
  • composer require whichbrowser/parser
    
    0 Một đối tượng chứa thông tin về hệ điều hành
    an object that contains information about the operating system
  • composer require whichbrowser/parser
    
    1 Một đối tượng chứa thông tin về thiết bị
    an object that contains information about the device

Functions:

composer require whichbrowser/parser
2 Trả về thuộc tính
composer require whichbrowser/parser
3 và
composer require whichbrowser/parser
4 của đối tượng
composer require whichbrowser/parser
1. Nếu một loại phụ có mặt, nó được kết hợp với loại và được tách biệt bởi một bán nguyệt, ví dụ:
composer require whichbrowser/parser
6 hoặc
composer require whichbrowser/parser
7. Nếu phân nhóm không được áp dụng, nó chỉ trả lại loại, ví dụ:
composer require whichbrowser/parser
8 hoặc
composer require whichbrowser/parser
9.
Returns the
composer require whichbrowser/parser
3 and
composer require whichbrowser/parser
4 property of the
composer require whichbrowser/parser
1 object. If a subtype is present it is concatenated to the type and seperated by a semicolor, for example:
composer require whichbrowser/parser
6 or
composer require whichbrowser/parser
7. If the subtype is not applicable, it just return the type, for example:
composer require whichbrowser/parser
8 or
composer require whichbrowser/parser
9.

composer update whichbrowser/parser
0 Nếu một đối số được sử dụng, hàm trả về
composer update whichbrowser/parser
1 nếu đối số khớp với
composer require whichbrowser/parser
3 của đối tượng
composer require whichbrowser/parser
1. Đối số cũng có thể tùy ý cung cấp một kiểu con bằng cách kết hợp nó với loại và tách nó bằng dấu chấm phẩy. Nó có thể sử dụng nhiều đối số trong trường hợp hàm trả về
composer update whichbrowser/parser
1 nếu một trong các đối số khớp. Nếu không có đối số nào khớp với nhau, nó sẽ trả về
composer update whichbrowser/parser
5
If a single argument is used, the function returns
composer update whichbrowser/parser
1 if the argument matches the
composer require whichbrowser/parser
3 propery of
composer require whichbrowser/parser
1 object. The argument can optionally also provide a subtype by concatenating it to the type and seperating it with a semicolon. It can use multiple arguments in which case the function returns
composer update whichbrowser/parser
1 if one of the arguments matches. If none of the arguments matches, it returns
composer update whichbrowser/parser
5

composer update whichbrowser/parser
6 Trả về
composer update whichbrowser/parser
1 Nếu trình duyệt là một thiết bị di động, như điện thoại, máy tính bảng, trình ereader, máy ảnh, trình phát phương tiện di động, đồng hồ hoặc bảng điều khiển chơi game di động. Nếu không, nó trả về
composer update whichbrowser/parser
5.
Return
composer update whichbrowser/parser
1 if the browser is a mobile device, like a phone, tablet, ereader, camera, portable media player, watch or portable gaming console. Otherwise it returns
composer update whichbrowser/parser
5.

composer update whichbrowser/parser
9 được sử dụng để truy vấn thuộc tính


    require 'vendor/autoload.php';
0 và


    require 'vendor/autoload.php';
1 của đối tượng
Opera/9.80 (X11; Linux zvav; U; zh) Presto/2.8.119 Version/11.10  
Opera Mini on a Nokia 5230 running Series60 5.0
8. Funcion có thể chứa một đối số duy nhất để so sánh đơn giản dựa trên


    require 'vendor/autoload.php';
0 hoặc ba đối số để so sánh cả


    require 'vendor/autoload.php';
0 và


    require 'vendor/autoload.php';
1. Đối số đầu tiên luôn chứa tên của trình duyệt. Các đối số thứ hai là một chuỗi có thể chứa


    require 'vendor/autoload.php';
6,


    require 'vendor/autoload.php';
7,


    require 'vendor/autoload.php';
8,


    require 'vendor/autoload.php';
9 hoặc
$result = new WhichBrowser\Parser(getallheaders());
0. Thứ ba là một số nguyên, float hoặc chuỗi chứa phiên bản. Bạn có thể sử dụng các phiên bản như
$result = new WhichBrowser\Parser(getallheaders());
1,
$result = new WhichBrowser\Parser(getallheaders());
2 hoặc
$result = new WhichBrowser\Parser(getallheaders());
3. Để biết thêm thông tin về cách thực hiện so sánh phiên bản, vui lòng xem hàm
$result = new WhichBrowser\Parser(getallheaders());
4 của đối tượng
$result = new WhichBrowser\Parser(getallheaders());
5.
Is used to query the


    require 'vendor/autoload.php';
0 and


    require 'vendor/autoload.php';
1 property of the
Opera/9.80 (X11; Linux zvav; U; zh) Presto/2.8.119 Version/11.10  
Opera Mini on a Nokia 5230 running Series60 5.0
8 object. The funcion can contain a single argument to a simple comparison based on


    require 'vendor/autoload.php';
0, or three arguments to compare both


    require 'vendor/autoload.php';
0 and


    require 'vendor/autoload.php';
1. The first argument always contains the name of the browser. The second arguments is a string that can container either


    require 'vendor/autoload.php';
6,


    require 'vendor/autoload.php';
7,


    require 'vendor/autoload.php';
8,


    require 'vendor/autoload.php';
9 or
$result = new WhichBrowser\Parser(getallheaders());
0. The third is an integer, float or string that contains the version. You can use versions like
$result = new WhichBrowser\Parser(getallheaders());
1,
$result = new WhichBrowser\Parser(getallheaders());
2 or
$result = new WhichBrowser\Parser(getallheaders());
3. For more information about how version comparisons are performed, please see the
$result = new WhichBrowser\Parser(getallheaders());
4 function of the
$result = new WhichBrowser\Parser(getallheaders());
5 object.

$result = new WhichBrowser\Parser(getallheaders());
6 được sử dụng để truy vấn thuộc tính


    require 'vendor/autoload.php';
0 và


    require 'vendor/autoload.php';
1 của đối tượng
Opera/9.80 (X11; Linux zvav; U; zh) Presto/2.8.119 Version/11.10  
Opera Mini on a Nokia 5230 running Series60 5.0
9. Hàm này hoạt động theo cách chính xác giống như
$result = new WhichBrowser\Parser($_SERVER['HTTP_USER_AGENT']);
0.
Is used to query the


    require 'vendor/autoload.php';
0 and


    require 'vendor/autoload.php';
1 property of the
Opera/9.80 (X11; Linux zvav; U; zh) Presto/2.8.119 Version/11.10  
Opera Mini on a Nokia 5230 running Series60 5.0
9 object. This function works in exactly the same way as
$result = new WhichBrowser\Parser($_SERVER['HTTP_USER_AGENT']);
0.

$result = new WhichBrowser\Parser($_SERVER['HTTP_USER_AGENT']);
1 được sử dụng để truy vấn thuộc tính


    require 'vendor/autoload.php';
0 và


    require 'vendor/autoload.php';
1 của đối tượng
composer require whichbrowser/parser
0. Hàm này hoạt động theo cách chính xác giống như
$result = new WhichBrowser\Parser($_SERVER['HTTP_USER_AGENT']);
0.
Is used to query the


    require 'vendor/autoload.php';
0 and


    require 'vendor/autoload.php';
1 property of the
composer require whichbrowser/parser
0 object. This function works in exactly the same way as
$result = new WhichBrowser\Parser($_SERVER['HTTP_USER_AGENT']);
0.

$result = new WhichBrowser\Parser($_SERVER['HTTP_USER_AGENT']);
6 Có thực sự có một số trình duyệt được phát hiện, hoặc chúng ta đã không phát hiện ra bất cứ điều gì?
Is there actually some browser detected, or did we fail to detect anything?

Opera/9.80 (X11; Linux zvav; U; zh) Presto/2.8.119 Version/11.10  
Opera Mini on a Nokia 5230 running Series60 5.0
1 Nhận một đại diện dễ đọc của con người về trình duyệt được phát hiện, bao gồm cả hệ điều hành và thông tin thiết bị.
Get a human readable representation of the detected browser, including operating system and device information.

Đối tượng trình duyệt

Một đối tượng của lớp

$result = new WhichBrowser\Parser($_SERVER['HTTP_USER_AGENT']);
8 được sử dụng cho thuộc tính
Opera/9.80 (X11; Linux zvav; U; zh) Presto/2.8.119 Version/11.10  
Opera Mini on a Nokia 5230 running Series60 5.0
8 của đối tượng chính
Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform
9 và chứa một số thuộc tính. Nếu một tài sản không được áp dụng trong tình huống này, nó sẽ không được xác định.

Properties:

  • 
    
        require 'vendor/autoload.php';
    0 Một chuỗi chứa tên của trình duyệt
    a string containing the name of the browser
  • "You are using " . $result->toString();
    // You are using Chrome 27 on OS X Mountain Lion 10.8
    2 Một chuỗi chứa một tên thay thế của trình duyệt
    a string containing an alternative name of the browser
  • 
    
        require 'vendor/autoload.php';
    1 Một đối tượng phiên bản chứa thông tin về phiên bản của trình duyệt
    a version object containing information about the version of the browser
  • "You are using " . $result->toString();
    // You are using Chrome 27 on OS X Mountain Lion 10.8
    4 Boolean, đúng nếu trình duyệt là trình duyệt mặc định của hệ điều hành, sai nếu không
    a boolean, true if the browser is the default browser of the operating system, false otherwise
  • "You are using " . $result->toString();
    // You are using Chrome 27 on OS X Mountain Lion 10.8
    5 Một chuỗi chứa kênh phân phối, tức là. 'Đêm' hoặc 'tiếp theo'.
    a string containing the distribution channel, ie. 'Nightly' or 'Next'.
  • "You are using " . $result->toString();
    // You are using Chrome 27 on OS X Mountain Lion 10.8
    6 Một chuỗi có thể chứa chế độ hoạt động của trình duyệt, tức là. 'Ủy quyền'.
    a string that can contain the operating mode of the browser, ie. 'proxy'.
  • "You are using " . $result->toString();
    // You are using Chrome 27 on OS X Mountain Lion 10.8
    7 Boolean đúng nếu trình duyệt không có tên và là mặc định của hệ điều hành.
    a boolean that is true if the browser does not have a name and is the default of the operating system.
  • "You are using " . $result->toString();
    // You are using Chrome 27 on OS X Mountain Lion 10.8
    8 Một đối tượng chứa thông tin về trình duyệt này của gia đình này
    an object that contains information about to which family this browser belongs
  • "You are using " . $result->toString();
    // You are using Chrome 27 on OS X Mountain Lion 10.8
    9 Một đối tượng có chứa thông tin về loại webview mà trình duyệt này sử dụng
    an object that contains information about to which kind of webview this browser uses

Functions:

$result->isType('desktop');
// true

$result->isType('mobile', 'tablet', 'media', 'gaming:portable');
// false

$result->isBrowser('Maxthon', '<', '4.0.5');
// false

$result->isOs('iOS', '>=', '8');
// false

$result->isOs('OS X');
// true

$result->isEngine('Blink');
// true
0 Gia đình của trình duyệt này có tên này, hoặc bản thân trình duyệt có tên này.
Does the family of this browser have this name, or does the browser itself have this name.

$result->isType('desktop');
// true

$result->isType('mobile', 'tablet', 'media', 'gaming:portable');
// false

$result->isBrowser('Maxthon', '<', '4.0.5');
// false

$result->isOs('iOS', '>=', '8');
// false

$result->isOs('OS X');
// true

$result->isEngine('Blink');
// true
1 là trình duyệt sử dụng WebView bằng tên được cung cấp.
Is the browser using a webview using with the provided name.

$result->isType('desktop');
// true

$result->isType('mobile', 'tablet', 'media', 'gaming:portable');
// false

$result->isBrowser('Maxthon', '<', '4.0.5');
// false

$result->isOs('iOS', '>=', '8');
// false

$result->isOs('OS X');
// true

$result->isEngine('Blink');
// true
2 Lấy tên của trình duyệt
Get the name of the browser

$result->isType('desktop');
// true

$result->isType('mobile', 'tablet', 'media', 'gaming:portable');
// false

$result->isBrowser('Maxthon', '<', '4.0.5');
// false

$result->isOs('iOS', '>=', '8');
// false

$result->isOs('OS X');
// true

$result->isEngine('Blink');
// true
3 Nhận phiên bản trình duyệt
Get the version of the browser

Opera/9.80 (X11; Linux zvav; U; zh) Presto/2.8.119 Version/11.10  
Opera Mini on a Nokia 5230 running Series60 5.0
1 Nhận một đại diện dễ đọc của con người của trình duyệt được phát hiện
Get a human readable representation of the detected browser

Đối tượng động cơ

Một đối tượng của lớp

$result->isType('desktop');
// true

$result->isType('mobile', 'tablet', 'media', 'gaming:portable');
// false

$result->isBrowser('Maxthon', '<', '4.0.5');
// false

$result->isOs('iOS', '>=', '8');
// false

$result->isOs('OS X');
// true

$result->isEngine('Blink');
// true
5 được sử dụng cho thuộc tính
Opera/9.80 (X11; Linux zvav; U; zh) Presto/2.8.119 Version/11.10  
Opera Mini on a Nokia 5230 running Series60 5.0
9 của đối tượng chính
Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform
9 và chứa một số thuộc tính. Nếu một tài sản không được áp dụng trong tình huống này, nó sẽ không được xác định.

Properties:

  • 
    
        require 'vendor/autoload.php';
    0 Một chuỗi chứa tên của công cụ kết xuất
    a string containing the name of the rendering engine
  • 
    
        require 'vendor/autoload.php';
    1 Một đối tượng phiên bản chứa thông tin về phiên bản của công cụ kết xuất
    a version object containing information about the version of the rendering engine

Functions:

$result->isType('desktop');
// true

$result->isType('mobile', 'tablet', 'media', 'gaming:portable');
// false

$result->isBrowser('Maxthon', '<', '4.0.5');
// false

$result->isOs('iOS', '>=', '8');
// false

$result->isOs('OS X');
// true

$result->isEngine('Blink');
// true
2 Lấy tên của công cụ kết xuất
Get the name of the rendering engine

$result->isType('desktop');
// true

$result->isType('mobile', 'tablet', 'media', 'gaming:portable');
// false

$result->isBrowser('Maxthon', '<', '4.0.5');
// false

$result->isOs('iOS', '>=', '8');
// false

$result->isOs('OS X');
// true

$result->isEngine('Blink');
// true
3 Nhận phiên bản của công cụ kết xuất
Get the version of the rendering engine

Opera/9.80 (X11; Linux zvav; U; zh) Presto/2.8.119 Version/11.10  
Opera Mini on a Nokia 5230 running Series60 5.0
1 Nhận một đại diện dễ đọc của con người về công cụ kết xuất được phát hiện
Get a human readable representation of the detected rendering engine

Đối tượng hệ điều hành

Một đối tượng của lớp

Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform
03 được sử dụng cho thuộc tính
composer require whichbrowser/parser
0 của đối tượng chính
Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform
9 và chứa một số thuộc tính. Nếu một tài sản không được áp dụng trong tình huống này, nó sẽ không được xác định.

Properties:

  • 
    
        require 'vendor/autoload.php';
    0 Một chuỗi chứa tên của hệ điều hành
    a string containing the name of the operating system
  • 
    
        require 'vendor/autoload.php';
    1 Một đối tượng phiên bản chứa thông tin về phiên bản của hệ điều hành
    a version object containing information about the version of the operating system
  • "You are using " . $result->toString();
    // You are using Chrome 27 on OS X Mountain Lion 10.8
    8 Một đối tượng chứa thông tin về gia đình nào hệ điều hành này thuộc về
    an object that contains information about to which family this operating system belongs

Functions:

$result->isType('desktop');
// true

$result->isType('mobile', 'tablet', 'media', 'gaming:portable');
// false

$result->isBrowser('Maxthon', '<', '4.0.5');
// false

$result->isOs('iOS', '>=', '8');
// false

$result->isOs('OS X');
// true

$result->isEngine('Blink');
// true
0 Gia đình của hệ điều hành này có tên này hay chính hệ điều hành có tên này.
Does the family of this operating system have this name, or does the operating system itself have this name.

$result->isType('desktop');
// true

$result->isType('mobile', 'tablet', 'media', 'gaming:portable');
// false

$result->isBrowser('Maxthon', '<', '4.0.5');
// false

$result->isOs('iOS', '>=', '8');
// false

$result->isOs('OS X');
// true

$result->isEngine('Blink');
// true
2 Lấy tên của hệ điều hành
Get the name of the operating system

$result->isType('desktop');
// true

$result->isType('mobile', 'tablet', 'media', 'gaming:portable');
// false

$result->isBrowser('Maxthon', '<', '4.0.5');
// false

$result->isOs('iOS', '>=', '8');
// false

$result->isOs('OS X');
// true

$result->isEngine('Blink');
// true
3 Nhận phiên bản của hệ điều hành
Get the version of the operating system

Opera/9.80 (X11; Linux zvav; U; zh) Presto/2.8.119 Version/11.10  
Opera Mini on a Nokia 5230 running Series60 5.0
1 Nhận một đại diện dễ đọc của con người của hệ điều hành được phát hiện
Get a human readable representation of the detected operating system

Đối tượng thiết bị

Một đối tượng của lớp

Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform
13 được sử dụng cho thuộc tính
composer require whichbrowser/parser
1 của đối tượng chính
Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform
9 và chứa một số thuộc tính. Nếu một tài sản không được áp dụng trong tình huống này, nó sẽ không được xác định.

Properties:

  • composer require whichbrowser/parser
    
    3 Một chuỗi chứa loại trình duyệt.
    a string containing the type of the browser.
  • composer require whichbrowser/parser
    
    4 Một chuỗi chứa kiểu con của trình duyệt.
    a string containing the subtype of the browser.
  • Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
    Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform
    
    18 Boolean là đúng nếu thiết bị đã được xác định tích cực.
    a boolean that is true if the device has been positively identified.
  • Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
    Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform
    
    19 Một chuỗi chứa nhà sản xuất thiết bị, tức là. 'Apple' hoặc 'Samsung'.
    a string containing the manufacturer of the device, ie. 'Apple' or 'Samsung'.
  • Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
    Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform
    
    20 dưới dạng chuỗi chứa mô hình của thiết bị, tức là. 'iPhone' hoặc 'Galaxy S4'.
    as string containing the model of the device, ie. 'iPhone' or 'Galaxy S4'.

Thuộc tính

composer require whichbrowser/parser
3 có thể chứa bất kỳ giá trị nào từ danh sách sau:

  • Máy tính để bàn
  • di động
  • PDA
  • DECT
  • máy tính bảng
  • chơi game
  • người sắp xếp
  • phương tiện truyền thông
  • tai nghe
  • đồng hồ
  • giả lập
  • Tivi
  • màn hình
  • Máy ảnh
  • Máy in
  • bảng chỉ dẫn
  • Bảng trắng
  • DevBoard
  • Biến động
  • thiết bị
  • GPS
  • xe hơi
  • POS
  • người máy
  • máy chiếu

Nếu

composer require whichbrowser/parser
3 là "di động", thuộc tính
composer require whichbrowser/parser
4 có thể chứa bất kỳ giá trị nào từ danh sách sau:

  • tính năng
  • thông minh

Nếu

composer require whichbrowser/parser
3 là "chơi game", thuộc tính
composer require whichbrowser/parser
4 có thể chứa bất kỳ giá trị nào từ danh sách sau:

  • Bảng điều khiển
  • cầm tay

Functions:

Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform
26 Lấy tên của nhà sản xuất
Get the name of the manufacturer

Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform
27 Lấy tên của mô hình
Get the name of the model

Opera/9.80 (X11; Linux zvav; U; zh) Presto/2.8.119 Version/11.10  
Opera Mini on a Nokia 5230 running Series60 5.0
1 Nhận đại diện cho con người của thiết bị được phát hiện
Get a human readable representation of the detected device

Đối tượng gia đình

Một đối tượng của lớp

Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform
29 được sử dụng cho thuộc tính
"You are using " . $result->toString();
// You are using Chrome 27 on OS X Mountain Lion 10.8
8 của đối tượng
$result = new WhichBrowser\Parser($_SERVER['HTTP_USER_AGENT']);
8 và
Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform
03 và chứa một số thuộc tính. Nếu một tài sản không được áp dụng trong tình huống này, nó sẽ không được xác định.

Properties:

  • 
    
        require 'vendor/autoload.php';
    0 Một chuỗi chứa tên của gia đình
    a string containing the name of the family
  • 
    
        require 'vendor/autoload.php';
    1 Một đối tượng phiên bản chứa thông tin về phiên bản của gia đình
    a version object containing information about the version of the family

Functions:

$result->isType('desktop');
// true

$result->isType('mobile', 'tablet', 'media', 'gaming:portable');
// false

$result->isBrowser('Maxthon', '<', '4.0.5');
// false

$result->isOs('iOS', '>=', '8');
// false

$result->isOs('OS X');
// true

$result->isEngine('Blink');
// true
2 lấy tên của gia đình
Get the name of the family

$result->isType('desktop');
// true

$result->isType('mobile', 'tablet', 'media', 'gaming:portable');
// false

$result->isBrowser('Maxthon', '<', '4.0.5');
// false

$result->isOs('iOS', '>=', '8');
// false

$result->isOs('OS X');
// true

$result->isEngine('Blink');
// true
3 Nhận phiên bản của gia đình
Get the version of the family

Opera/9.80 (X11; Linux zvav; U; zh) Presto/2.8.119 Version/11.10  
Opera Mini on a Nokia 5230 running Series60 5.0
1 Nhận một đại diện dễ đọc của con người về gia đình
Get a human readable representation of the family

Đối tượng sử dụng

Một đối tượng của lớp

Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform
38 được sử dụng cho thuộc tính
"You are using " . $result->toString();
// You are using Chrome 27 on OS X Mountain Lion 10.8
9 của đối tượng
$result = new WhichBrowser\Parser($_SERVER['HTTP_USER_AGENT']);
8 và chứa một số thuộc tính. Nếu một tài sản không được áp dụng trong tình huống này, nó sẽ không được xác định.

Properties:

  • 
    
        require 'vendor/autoload.php';
    0 Một chuỗi chứa tên của WebView
    a string containing the name of the webview
  • 
    
        require 'vendor/autoload.php';
    1 Một đối tượng phiên bản chứa thông tin về phiên bản của WebView
    a version object containing information about the version of the webview

Functions:

$result->isType('desktop');
// true

$result->isType('mobile', 'tablet', 'media', 'gaming:portable');
// false

$result->isBrowser('Maxthon', '<', '4.0.5');
// false

$result->isOs('iOS', '>=', '8');
// false

$result->isOs('OS X');
// true

$result->isEngine('Blink');
// true
2 Nhận tên của WebView
Get the name of the webview

$result->isType('desktop');
// true

$result->isType('mobile', 'tablet', 'media', 'gaming:portable');
// false

$result->isBrowser('Maxthon', '<', '4.0.5');
// false

$result->isOs('iOS', '>=', '8');
// false

$result->isOs('OS X');
// true

$result->isEngine('Blink');
// true
3 Nhận phiên bản của WebView
Get the version of the webview

Opera/9.80 (X11; Linux zvav; U; zh) Presto/2.8.119 Version/11.10  
Opera Mini on a Nokia 5230 running Series60 5.0
1 Nhận một đại diện dễ đọc của con người về WebView
Get a human readable representation of the webview

Đối tượng phiên bản

Một đối tượng của lớp

Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform
46 được sử dụng cho thuộc tính


    require 'vendor/autoload.php';
1 của đối tượng
Opera/9.80 (X11; Linux zvav; U; zh) Presto/2.8.119 Version/11.10  
Opera Mini on a Nokia 5230 running Series60 5.0
8,
Opera/9.80 (X11; Linux zvav; U; zh) Presto/2.8.119 Version/11.10  
Opera Mini on a Nokia 5230 running Series60 5.0
9 và
composer require whichbrowser/parser
0 và chứa một số thuộc tính và hàm. Nếu một tài sản không được áp dụng trong tình huống này, nó sẽ không được xác định.

Properties:

  • Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
    Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform
    
    51 Một chuỗi chứa số phiên bản gốc.
    a string containing the original version number.
  • "You are using " . $result->toString();
    // You are using Chrome 27 on OS X Mountain Lion 10.8
    2 Một chuỗi chứa bí danh cho số phiên bản, tức là. 'XP' cho Windows '5.1'.
    a string containing an alias for the version number, ie. 'XP' for Windows '5.1'.
  • Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
    Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform
    
    53 Một chuỗi chứa một biệt danh cho số phiên bản, tức là. 'Mojave' cho OS X '10 .14 '.
    a string containing a nickname for the version number, ie. 'Mojave' for OS X '10.14'.
  • Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
    Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform
    
    54 Một số nguyên chứa số chữ số của số phiên bản nên được in.
    an integer containing the number of digits of the version number that should be printed.

Functions:

Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform
55 hoặc
Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform
56 Sử dụng chức năng này, thật dễ dàng để so sánh phiên bản với phiên bản khác. Nếu bạn chỉ định một đối số, hàm này sẽ trả về nếu các phiên bản giống nhau. Bạn cũng có thể chỉ định hai đối số, trong trường hợp đó, đối số đầu tiên chứa toán tử so sánh, chẳng hạn như


    require 'vendor/autoload.php';
6,


    require 'vendor/autoload.php';
7,


    require 'vendor/autoload.php';
8,


    require 'vendor/autoload.php';
9 hoặc
$result = new WhichBrowser\Parser(getallheaders());
0. Đối số thứ hai là phiên bản bạn muốn so sánh nó với. Bạn có thể sử dụng các phiên bản như
$result = new WhichBrowser\Parser(getallheaders());
1,
$result = new WhichBrowser\Parser(getallheaders());
2 hoặc
$result = new WhichBrowser\Parser(getallheaders());
3, nhưng lưu ý rằng
$result = new WhichBrowser\Parser(getallheaders());
1 không giống như
Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform
66. Ví dụ: nếu phiên bản hệ điều hành của chúng tôi là
Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform
67:
Using this function it is easy to compare a version to another version. If you specify only one argument, this function will return if the versions are the same. You can also specify two arguments, in that case the first argument contains the comparison operator, such as


    require 'vendor/autoload.php';
6,


    require 'vendor/autoload.php';
7,


    require 'vendor/autoload.php';
8,


    require 'vendor/autoload.php';
9 or
$result = new WhichBrowser\Parser(getallheaders());
0. The second argument is the version you want to compare it to. You can use versions like
$result = new WhichBrowser\Parser(getallheaders());
1,
$result = new WhichBrowser\Parser(getallheaders());
2 or
$result = new WhichBrowser\Parser(getallheaders());
3, but be aware that
$result = new WhichBrowser\Parser(getallheaders());
1 is not the same as
Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform
66. For example if our OS version is
Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform
67:

Mozilla/5.0 (Series40; Nokia501/10.0.2; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.0.0.0.73  
Nokia Xpress 3.0.0 on a Nokia Asha 501 running Nokia Asha Platform
7