Skip to content
This repository has been archived by the owner on Jul 18, 2022. It is now read-only.

Probably the fastest script to detect browser version with PHP

Notifications You must be signed in to change notification settings

GabrielDelepine/browser-regex-detector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

What's this project ?

A PHP script who analyse the user agent and define the browser name, the browser version and the plateform.

Why should I use this script ?

To save execution time (the script takes less than 1ms) ! It's faster to make a regex on a string than use a "database" like the browscap.ini file.

Demo

You can try the script in the demo page. If you find a user agent who is not correctly detected please open an issue.

Limit of the concept

This script will only give you few information about the browser. If you need to know more like browser capabilities, you should check for another project like the Browscap project for example.

Sources

I found a pice of code here and here. I don't know who wrote-it first.

Future improvement

  • Detect the device type (Desktop|Tablet|Mobile)
  • Demo page to try with different user agent
  • ini file to define if a browser is supported or not by your application
  • Version of the plateform (ex : XP / w7 / W8 / ...)

About

Probably the fastest script to detect browser version with PHP

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages