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.
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.
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.