Return to Snippet

Revision: 10386
at December 23, 2008 19:54 by aristoworks


Initial Code
function is_firefox() {
	$agent = '';
	// old php user agent can be found here
	if (!empty($HTTP_USER_AGENT))
		$agent = $HTTP_USER_AGENT;
	// newer versions of php do have useragent here.
	if (empty($agent) && !empty($_SERVER["HTTP_USER_AGENT"]))
		$agent = $_SERVER["HTTP_USER_AGENT"];
	if (!empty($agent) && preg_match("/firefox/si", $agent))
		return true;
	return false;
}

Initial URL
http://www.aristoworks.com

Initial Description
This handy little script will allow you to detect whether or not a user is running FireFox as their browser.

Initial Title
PHP Firefox Detector

Initial Tags
php, browser

Initial Language
PHP