note 97154 deleted from function.get-browser by cmb

From: Date: Sun, 23 Feb 2020 08:59:12 +0000
Subject: note 97154 deleted from function.get-browser by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-214203@lists.php.net to get a copy of this message
Note Submitter: Becheru Petru-Ioan ---- 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('_'); ?>

« previous php.notes (#214203) next »