-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.php
More file actions
50 lines (42 loc) · 1.31 KB
/
test.php
File metadata and controls
50 lines (42 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="Generator" content="EditPlus®">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
<title>UserAgent</title>
<style>
pre {
display: block;
font-family: -moz-fixed;
white-space: pre-wrap;
margin: 1em 0;
}
</style>
</head>
<body>
<?php
require_once('UAParser.php');
$uap = new frogotfish\UAParser\UAParser();
$uadata = $uap->getResult();
echo("<pre>");
echo("\nVersion: ".$uap->version);
echo("\n");
echo("\nUserAgent: ".$uadata->ua);
echo("\n");
echo("\nOS: ".$uadata->os->toString());
echo("\nCPU: ".$uadata->cpu->toString('undefined'));
echo("\nDevice: ".$uadata->device->toString('undefined'));
echo("\nBrowser: ".$uadata->browser->toString());
echo("\n");
echo("\nEdge: ".($uadata->browser->is("Edge")? 'true' : 'false'));
echo("\nMobile: ".($uadata->device->is("Mobile")? 'true' : 'false'));
echo("\niOS: ".($uadata->os->is("iOS")? 'true' : 'false'));
echo("\nsmarttv: ".($uadata->device->is("smarttv")? 'true' : 'false'));
echo("\nSamsung: ".($uadata->device->is("Samsung")? 'true' : 'false'));
?>
</body>
</html>