note 13989 added to function.get-browser.php

From: Date: Thu, 12 Jul 2001 17:49:23 +0000
Subject: note 13989 added to function.get-browser.php
Groups: php.notes 
Request: Send a blank email to php-notes+get-15288@lists.php.net to get a copy of this message
I had a similar problem. I went online and did a search with google, and came across a post at PHPBuilder.com. The code the Bert Laga suggested was this: if((ereg("Nav", getenv("HTTP_USER_AGENT"))) || (ereg("Gold", getenv("HTTP_USER_AGENT"))) || (ereg("X11", getenv("HTTP_USER_AGENT"))) || (ereg("Mozilla", getenv("HTTP_USER_AGENT"))) || (ereg("Netscape", getenv("HTTP_USER_AGENT"))) AND (!ereg("MSIE", getenv("HTTP_USER_AGENT")))) $browser = "Netscape"; elseif(ereg("MSIE", getenv("HTTP_USER_AGENT"))) $browser = "MSIE"; else $browser = "Other"; Seems thorough enough, eh? http://www.php.net/manual/en/function.get-browser.php

« previous php.notes (#15288) next »