Did you know that PHP has a built in function to detect which browser your page visitor is running? Try :
< ?
$get_visitor_browser = get_browser(null,true);
print_r($get_visitor_browser);
?>
The output of this function is an object which includes details of the user’s browser:
[browser_name_regex] => ^mozilla/5.0 (windows; .*; windows nt 5.1.*) gecko/.* firefox/1.5.*$
[browser_name_pattern] => Mozilla/5.0 (Windows; *; Windows NT 5.1*) Gecko/* Firefox/1.5*
[parent] => Firefox 1.5
[platform] => WinXP
[browser] => Firefox
[version] => 1.5
[majorver] => 1
[minorver] => 5
[css] => 2
[frames] => 1
[iframes] => 1
[tables] => 1
[cookies] => 1
[javascript] => 1
[javaapplets] => 1
To get PHP to detect your browser properly, you’ll have to get the updated browsecap.ini file and set the path to the file in your php.ini file.
To set the path to browsecap.ini file, add the following entries in your php.ini file (if it does not exist already):
[browscap]
browscap = /specify/path/to/browscap.ini
Get the browsecap.ini file: http://browsers.garykeith.com/downloads.asp
PHP get_browser() details at php.net : http://in.php.net/manual/en/function.get-browser.php



Just use http://checkbrowser.info to detect browsers
not working Warning: get_browser() [function.get-browser]: browscap ini directive not set. in W:\www\index.php on line 2
for mobile phone browsers, you would use something like handsetdetection.com which detects the phone, screensize, browser type and even location
What about mobile phone browsers?