note 38411 deleted from function.preg-match by nlopess

From: Date: Fri, 19 Dec 2003 16:42:10 +0000
Subject: note 38411 deleted from function.preg-match by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-62245@lists.php.net to get a copy of this message
Note Submitter: ovidiu underscore c at linuxmail dot org ---- Simple function that checks whether the visitor uses M$ Internet Explorer 4 or higher. I used it to conditionally display an "Add to active desktop" button. I hope someone else finds it useful :) function ie4_or_higher() { $ret = FALSE; if (preg_match('/MSIE ([0-9]\.[0-9])/', $_SERVER['HTTP_USER_AGENT'], $match)) { if ($match[1] >= 4) { $ret = TRUE; } } return $ret; }

« previous php.notes (#62245) next »