PHP - decoding custom agent WITHOUT get_browser

I have a site that allows my clients to customize content for their clients, I am currently logging stats using only date / time, ip and user agent.

I was about to process statistics into another table (or additional columns) using get_browser()

, but my useless host disabled this feature.

I spoke to the host and they say no to enable this, I would rather not switch hosts if possible.

I'm looking for a way to handle user agent strings to provide useful information, but I don't want to code too hard. I tried using a large list preg_match()

, but it gets too complicated.

Is there any other way to decode the user agent that I can use without the file browscap.ini

?

Alternatively, would it be possible to send statistics to third parties (eg Google Analytics) but on a per-customer basis so that I can disrupt customer use?

+3


source to share


1 answer


I have been using this class http://chrisschuld.com/projects/browser-php-detecting-a-users-browser-from-php/ in my project and it works very well.



+2


source







All Articles