Skip to content


Browser Detection in PHP

This sections will contains code regarding different PHP & MySQL features and contains help about php/mysql issues.

Browser Detection in PHP

Postby php developer » March 9th, 2009, 7:59 am

Browser detection in php is simple. You can detect the browser and OS version using PHP in two ways.

Method # 1
The first way to do it is simply by using the variable $HTTP_USER_AGENT, which holds information about browser version, name etc. Also you can use it like $_SERVER['HTTP_USER_AGENT']. This variable holds the information related to the browser and the operating system.

Method # 2
The second one is to use php's get_browser function, though it has it drawbacks, because you need a browsercap.ini which has to be present at your isp, it gives much more information than other ways.

click here for more info
User avatar
php developer
 
Posts: 53
Joined: July 25th, 2008, 4:56 am

Return to Board index

Return to PHP / MySQL / XML

Who is online

Users browsing this forum: No registered users and 0 guests