Browser.php - version 1.1 - released!

I updated the Browser.php class today to detect Google’s Chrome Browser. Additionally, thanks to an idea from Daniel ‘mavrick’ Lang, I added isBrowser($browserName) as a function to version 1.1.

Visit the Browser.php class page today to grab the update!

Interested in a PHP4 version? Daniel is maintaining a version for PHP4.

Example Usage:

$browser = new Browser();
if( ! ( $browser->getBrowser() == Browser::BROWSER_FIREFOX && $browser->getVersion() >= 2 ) ) {
	echo 'You have FireFox version 2 or greater';
}

// AND NOW…

if( $browser->isBrowser(Browser::BROWSER_CHROME) ) {
	echo '<p><strong>Hi Google Chrome User!</strong></p>';
}
[ php ]