note 6516 deleted from function.get-browser by sniper
| From: | sniper@php.net | Date: | Mon, 21 Oct 2002 01:51:02 +0000 |
| Subject: | note 6516 deleted from function.get-browser by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-38340@lists.php.net to get a copy of this message | ||
It's works (PHP 4.0.1pl2, Windows NT 4.0 build 1381,SVP 6)!!
Path in your ini-file is "browscap.ini", wich means the php-install-dir. I've got the
browscap.ini-file from http://asptracker.com/, So there are
some things to say: First you have to reaplace languageinformation throuh an asterix
($HTTP_USER_AGENT=eregi_replace("\[[a-z]{2,}\]", "*", $HTTP_USER_AGENT). Second:
With this browser.cap, you will need to get the whole infos by your own.
example:
$UA= getenv('HTTP_USER_AGENT');
$UA=eregi_replace("\[[a-z]{2,}\]", "*", $UA);
$array=get_Browser($UA);
while (list ($key, $value) = each ($array))
{
echo ("<b>$key:</b> $value<br>\n");
}
$array=get_Browser('Netscape 4.0');
while (list ($key, $value) = each ($array))
{
echo ("<b>$key:</b> $value<br>\n");
}
:-)