Simple Browser Detection

I wanted a simple and fast PHP browser detector for a script recently. Most scripts are either very out of date or huge and look for every single browser possible. ┬áHere’s a simple one that will return the major ones.

The trick was putting Chrome fairly near the start of the $browsers array or it gets missed!
Call browser_detect() which returns an array where
0=>Browser Name and version
1=>Browser Name
2=>Version

Leave a Reply

Your email address will not be published. Required fields are marked *