cbschuld / Browser.php

A PHP Class to detect a user's Browser. This encapsulation provides a breakdown of the browser and the version of the browser using the browser's user-agent string. This is not a guaranteed solution but provides an overall accurate way to detect what browser a user is using.
https://chrisschuld.com/projects/browser-php-detecting-a-users-browser-from-php/
MIT License
580 stars 303 forks source link

speed #95

Open BuslikDrev opened 3 years ago

BuslikDrev commented 3 years ago

I think that checking the user agent 50+ times is incorrect, you can speed up the script several times by disassembling the user agent, and then checking each parameter according to the conditions.

cbschuld commented 3 years ago

@BuslikDrev ; happy to take a PR with updates if you are able to help out