bendataclear
bendataclear

Reputation: 3850

PHP - Decoding user agent WITHOUT get_browser

I have a site which allows my customers to setup content for their customers, I'm currently capturing stats using just date/time, ip and user agent.

I was going to process the statistics into another table (or additional columns) using get_browser() but my useless host has disabled this functionality.

I've spoken to the host and they say no to turning this on, I'd rather not switch hosts if possible.

I am looking for a way to process the user agent strings to give useful information but I don't want to hard-code too much. I have tried using a large preg_match() list but it's getting too complex.

Is there any other method for decoding the user agent I can use without the browscap.ini file?

Alternatively could the statistics be shipped out to a third party (eg Google Analytics) but on a 'per customer' basis, so I can break down the usage by customer?

Upvotes: 3

Views: 910

Answers (1)

giker
giker

Reputation: 4245

I'm using this class http://chrisschuld.com/projects/browser-php-detecting-a-users-browser-from-php/ in my project and it's working really well.

Upvotes: 2

Related Questions