note 97154 modified in function.get-browser by danbrown

From: Date: Tue, 18 May 2010 15:05:44 +0000
Subject: note 97154 modified in function.get-browser by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-169356@lists.php.net to get a copy of this message
IE has a nasty bug called the Peekaboo bug that affected my website. 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('_'); ?> --was-- IE has a nasty bug called the Peekaboo bug that affected my website http://www.revistapadurilor.ro . 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('_'); ?> http://php.net/manual/en/function.get-browser.php

« previous php.notes (#169356) next »