note 22274 added to function.get-browser
| From: | lsantil at calstatela dot edu | Date: | Wed, 12 Jun 2002 17:05:12 +0000 |
| Subject: | note 22274 added to function.get-browser | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-31751@lists.php.net to get a copy of this message | ||
Here is an update to John Stuckey's post that lets you tell the difference between a Mozilla
4.x & 6.x browsers...
if( ereg( "Nav", $HTTP_USER_AGENT ) ||
ereg( "Gold", $HTTP_USER_AGENT ) ||
ereg( "X11", $HTTP_USER_AGENT ) ||
ereg( "Mozilla", $HTTP_USER_AGENT ) ||
ereg( "Netscape", $HTTP_USER_AGENT ) AND
!ereg( "MSIE", $HTTP_USER_AGENT ) AND
!ereg( "Gecko", $HTTP_USER_AGENT ) )
{
$browser = "Netscape";
}
else if( ereg( "MSIE", $HTTP_USER_AGENT ) AND
!ereg( "Gecko", $HTTP_USER_AGENT ) )
{
$browser = "MSIE";
}
else if( ereg( "Gecko", $HTTP_USER_AGENT ) )
{
$browser = "Mozilla";
}
else
{
$browser = "Other";
}
--
http://www.php.net/manual/en/function.get-browser.php
http://master.php.net/manage/user-notes.php?action=edit+22274
http://master.php.net/manage/user-notes.php?action=delete+22274
http://master.php.net/manage/user-notes.php?action=reject+22274