note 10058 added to get_browser
| From: | andrew at thepander dot co dot nz | Date: | Mon, 11 Dec 2000 07:05:22 +0000 |
| Subject: | note 10058 added to get_browser | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-8605@lists.php.net to get a copy of this message | ||
Here's a merged version of some of the above that checks for netscape 6 or ie. Someone else
could probably do a better job of it... but this did the trick to check for a browser with decent
CSS support:
$ver = intval(trim(substr(getenv('HTTP_USER_AGENT'), 8 +
strpos(getenv('HTTP_USER_AGENT'), "Mozilla"), 1)));
$str_css = ereg('MSIE',getenv('HTTP_USER_AGENT')) || $ver >= 5 ?
'basic.css' : 'ns4.css';
http://www.php.net/manual/function.get-browser.php