note 97153 added to function.get-browser
| From: | becheru dot petru dot ioan at gmail dot com | Date: | Sun, 04 Apr 2010 22:36:07 +0000 |
| Subject: | note 97153 added to function.get-browser | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-167699@lists.php.net to get a copy of this message | ||
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('_');
?>
----
Server IP: 69.147.83.197
Probable Submitter: 188.25.53.19
----
Manual Page -- http://www.php.net/manual/en/function.get-browser.php
Edit -- https://master.php.net/note/edit/97153
Del: integrated -- https://master.php.net/note/delete/97153/integrated
Del: useless -- https://master.php.net/note/delete/97153/useless
Del: bad code -- https://master.php.net/note/delete/97153/bad+code
Del: spam -- https://master.php.net/note/delete/97153/spam
Del: non-english -- https://master.php.net/note/delete/97153/non-english
Del: in docs -- https://master.php.net/note/delete/97153/in+docs
Del: other reasons-- https://master.php.net/note/delete/97153
Reject -- https://master.php.net/note/reject/97153
Search -- https://master.php.net/manage/user-notes.php