PHP Classes

File: app/vendor/foroco/php-browser-detection/tests/single.php

Recommend this page to a friend!
  Classes of Faris AL-Otabi   PHP IP Logger   app/vendor/foroco/php-browser-detection/tests/single.php   Download  
File: app/vendor/foroco/php-browser-detection/tests/single.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP IP Logger
Track user IP addresses that access certain pages
Author: By
Last change:
Date: 1 year ago
Size: 934 bytes
 

Contents

Class file image Download
<?php

require_once('../src/BrowserDetection.php');
$Browser = new foroco\BrowserDetection();

// Testing one single User-Agent string

$useragent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36';

$time_start = microtime(true);

// Detect all possible environment data from User-Agent
$result = $Browser->getAll($useragent);

echo
'<div style="font-size:16px; font-weight:bold"><pre>';
echo
$useragent;
echo
'</pre></div>';

echo
'<div style="font-size:18px; font-weight:bold"><pre>';
print_r($result);
echo
'</pre></div>';

echo
'<div style="font-size:16px; font-weight:bold"><pre>';
echo
'--------------------------------------------------------------------------------';
echo
'</pre></div>';

$time_end = microtime(true);
$time_result = $time_end - $time_start;

echo
'<p style="font-size:21px">Total execution time: '.substr($time_result,0,7).' sec.</p>';

?>