Browser.php - version 1.1 - released!

- 08 Nov 2008

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>';
}


Related Posts: Extracting Smarty variables from source » Installing vzdump on CentOS 5.4 (32-bit) » Dumping Addresses from phplist » Adding NRPE (Nagios) to CentOS \/ RHEL Servers » Adding the REMI Repository to CentOS / RHEL / RedHat »

comments powered by Disqus