note 14924 added to function.get-browser.php

From: Date: Tue, 21 Aug 2001 16:22:38 +0000
Subject: note 14924 added to function.get-browser.php
Groups: php.notes 
Request: Send a blank email to php-notes+get-16958@lists.php.net to get a copy of this message
Salute Gentleman, The best way I see to test the browser on a PHP script seems like this: if (! ereg ("MSIE", getenv('HTTP_USER_AGENT'))) { echo "This browser isn't an IE, probably a Netscape one."; } else { echo "This an MS browser for sure!"; } It´s kinda simple but covers most of browsers on Internet. I didn't check if it works for older versions of IE. http://www.php.net/manual/en/function.get-browser.php

« previous php.notes (#16958) next »