PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Dragan Dinic   Browser Detection   example.php   Download  
File: example.php
Role: Unit test script
Content type: text/plain
Description: Example of usage
Class: Browser Detection
Determine the browser and OS from the user agent
Author: By
Last change:
Date: 18 years ago
Size: 306 bytes
 

Contents

Class file image Download
<?php

require_once("browser_detection.php");

$browser = Browser_Detection::get_browser($_SERVER['HTTP_USER_AGENT']);
if(
$browser !== false)
{
    echo
"Your browser is $browser <br />";
}

$os = Browser_Detection::get_os($_SERVER['HTTP_USER_AGENT']);

if(
$os !== false)
{
    echo
"Your OS is $os <br />";
}
?>