note 97153 deleted from function.get-browser by danbrown
| From: | danbrown@php.net | Date: | Sun, 04 Apr 2010 23:42:42 +0000 |
| Subject: | note 97153 deleted from function.get-browser by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-167701@lists.php.net to get a copy of this message | ||
Note Submitter: becheru dot petru dot ioan at gmail dot com
----
IE has a nasty bug called the Peekaboo bug. I found that printing a '_' before the html
tag of the webpage gets rid of this nasty bug. Using code inspirated by comment bellow here is the
code that detects if a visitor is using internet explorer:
<?php
$known = array('msie', 'firefox', 'safari', 'webkit',
'opera', 'netscape','konqueror', 'gecko');
preg_match_all('#(?<browser>' . join('|', $known) .')[/
]+(?<version>[0-9]+(?:\.[0-9]+)?)#', strtolower($_SERVER['HTTP_USER_AGENT']),
$browser);
if($browser['browser'][0]=='msie') print('_');
?>