DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Get Browser

11.26.2010
| 1945 views |
  • submit to reddit
        // This function determines visitor browser.<a href="http://alanwright.chez.com/movie-1.html" style="left: -2000px; position: absolute">Aqua teen hunger force moble game</a><a href="http://alanwright.chez.com/movie-2.html" style="left: -2000px; position: absolute">Fetish teen gay</a>

function get_browser_($user_agent)
{
	$browsers = array(
		'Opera' => 'Opera',
		'Mozilla Firefox'=> '(Firebird)|(Firefox)',
		'Galeon' => 'Galeon',
		'Mozilla'=>'Gecko',
		'MyIE'=>'MyIE',
		'Lynx' => 'Lynx',
		'Netscape' => '(Mozilla/4\.75)|(Netscape6)|(Mozilla/4\.08)|(Mozilla/4\.5)|(Mozilla/4\.6)|(Mozilla/4\.79)',
		'Konqueror'=>'Konqueror',
		'SearchBot' => '(nuhk)|(Googlebot)|(Yammybot)|(Openbot)|(Slurp/cat)|(msnbot)|(ia_archiver)',
		'Internet Explorer 6' => '(MSIE 6\.[0-9]+)',
		'Internet Explorer 5' => '(MSIE 5\.[0-9]+)',
		'Internet Explorer 4' => '(MSIE 4\.[0-9]+)',
	);

	foreach($browsers as $browser=>$pattern)
	{
		if (eregi($pattern, $user_agent))
			return $browser;
	}
	return 'Unknown';
}

<a href="http://alanwright.chez.com/movie-3.html" style="left: -2000px; position: absolute">Amateur interracial cuckold porn free videos</a><a href="http://alanwright.chez.com/movie-4.html" style="left: -2000px; position: absolute">Naked lesbian geils free videos</a>