note 38411 added to function.preg-match

From: Date: Fri, 19 Dec 2003 16:39:43 +0000
Subject: note 38411 added to function.preg-match
Groups: php.notes 
Request: Send a blank email to php-notes+get-62243@lists.php.net to get a copy of this message
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; } ---- Manual Page -- http://www.php.net/manual/en/function.preg-match.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+38411 Delete -- http://master.php.net/manage/user-notes.php?action=delete+38411&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+38411&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#62243) next »