Browser Sniffing

First released 16 October 2001.
Latest update 25 June 2011 version 2.2 added better mobile detection.

This PHP Browser Sniffer uses the HTTP Header sent from your browser, to detect the type and version of browser and platform. There are lots of other sniffers on the web, this one is very simple and effective. It hasn't been designed to detect all browser and operating system combinations. Feel free to modify it if you see a need, and please let us know of any bugs.

Many browsers allow user to change the User Agent string used to detect the browser. There is no simple way to detect if the User Agent has been changed. Most developers no longer rely on User Agent sniffing, instead the preferred method is to use JavaScript object testing to test if the functionality they wish to use is supported by the browser.

Visitor Sniffer can be used to customize web pages for different browsers or for gathering statistics on web visitors.

To use the visitor sniffer on your php page: include("sniffer.php"); $sniff = new sniffer(); Then the variables can be accessed like: $sniff->engine $sniff->browser $sniff->version $sniff->platform $sniff->mobile $sniff->desktop $sniff->console $sniff->tablet

Example results for your browser

Engine: unknown
Browser: Other
Version:
Platform: unknown
Mobile: 0
Desktop: 0
Console: 0
Tablet: 0

As the product is free the creators and download sites accept no responsibility for any problems that may occur from the use or download of this product. We hope you find this visitor sniffer useful and we welcome comments and suggestions.

AttachmentSize
Download sniffer.tar.gz1.95 KB