The Passionate Craftsman

Ruby, PHP, MySql, Software engineering and more.

Wednesday, 21 April 2010

How to detect browser type and version in PHP

You can use a simple class provided here: http://chrisschuld.com/projects/browser-php-detecting-a-users-browser-from-php/

A simple exmple:

if( $browser->getBrowser() == Browser::BROWSER_IE && $browser->getVersion() == 6 ) {
//do nothing
}
else {
// ok show something for non IE6 users
}

Labels:

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home