Use the phpinfo() function to return all of the variables associated with PHP. Towards the end of the page that has loaded within your web browser you will see the _SERVER variables. One of these variables, _SERVER["HTTP_USER_AGENT"], will return the description of the web browser you are using (I've omitted the dollar sign in front of the _SERVER, just in case it plays havoc with the forum !!)

As a quick test, using IE6, the server variable returns "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; www.lifetranslator.biz; InfoPath.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)".

Using Firefox returns "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9".

(tested on Windows XP Professional platform, using Apache Web Server)

Now if you create a simple index.php page and use a switch statement looking for specific information within the _SERVER["HTTP_USER_AGENT"] variable, you will be able to redirect web browsers on different platforms to the correct code pages.