Hey guys,
I’m using PHP’s $_SERVER[‘HTTP_USER_AGENT’] to determine the users OS and Browser and all that. What I was wondering if any of you awesome gurus out there knew a decent way to strip out just the OS portion of that.
Outputs look like this:
Linux/Ubuntu:
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20041013 Firefox/0.9.3 (Ubuntu)
WinXP:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)
Mac:
(If anyone has a mac and wouldn’t mind going to www.ratherlargefire.com so that your info is logged, and telling me that you went that’d be great.)
So that’s how it outputs. Anyone have any idea, or a point in the right direction? I could use some strpos stuff with some if statements and all, but there isn’t enough information right now for that, so it’d be better if there was another way that would do it without me hardcoding in options.
Thanks