@@ -14,7 +14,7 @@ This library requires PHP 5.3 or higher.
14
14
15
15
## Manual installation
16
16
17
- 1 . Simply upload library file ` BrowserDetection.php ` (placed in the ` src ` directory) to your project;\
17
+ 1 . Simply upload library file ` BrowserDetection.php ` (placed in the ` src ` directory) to your project;
18
18
2 . Connect PHP library file by using ` require_once ` :
19
19
20
20
``` php
@@ -206,12 +206,13 @@ To detect all possible environment data use:
206
206
207
207
``` php
208
208
<?php
209
- require_once('BrowserDetection.php');
209
+
210
210
$Browser = new foroco\BrowserDetection();
211
211
212
212
$useragent = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.4150.0 Iron Safari/537.36';
213
213
$result = $Browser->getAll($useragent);
214
214
print_r($result);
215
+
215
216
?>
216
217
```
217
218
@@ -248,12 +249,13 @@ To parse only OS data use:
248
249
249
250
``` php
250
251
<?php
251
- require_once('BrowserDetection.php');
252
+
252
253
$Browser = new foroco\BrowserDetection();
253
254
254
255
$useragent = 'Mozilla/5.0 (Linux; arm_64; Android 9; LLD-L31) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.136 YaBrowser/20.2.4.153.00 Mobile Safari/537.36';
255
256
$result = $Browser->getOS($useragent);
256
257
print_r($result);
258
+
257
259
?>
258
260
```
259
261
@@ -277,12 +279,13 @@ To parse only browser data use:
277
279
278
280
``` php
279
281
<?php
280
- require_once('BrowserDetection.php');
282
+
281
283
$Browser = new foroco\BrowserDetection();
282
284
283
285
$useragent = 'Mozilla/5.0 (iPad; CPU OS 9_3_4 like Mac OS X) AppleWebKit/601.1 (KHTML, like Gecko) CriOS/80.0.3987.122 Mobile/13G35 Safari/601.1.46';
284
286
$result = $Browser->getBrowser($useragent);
285
287
print_r($result);
288
+
286
289
?>
287
290
```
288
291
@@ -312,12 +315,13 @@ To parse only device type data use:
312
315
313
316
``` php
314
317
<?php
315
- require_once('BrowserDetection.php');
318
+
316
319
$Browser = new foroco\BrowserDetection();
317
320
318
321
$useragent = 'Mozilla/5.0 (SMART-TV; Linux; Tizen 5.0) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/2.2 Chrome/63.0.3239.84 TV Safari/537.36';
319
322
$result = $Browser->getDevice($useragent);
320
323
print_r($result);
324
+
321
325
?>
322
326
```
323
327
@@ -336,13 +340,14 @@ To detect if mobile browser works in `Desktop Mode` use:
336
340
337
341
``` php
338
342
<?php
339
- require_once('BrowserDetection.php');
343
+
340
344
$Browser = new foroco\BrowserDetection();
341
345
342
346
$useragent = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36';
343
347
$Browser->setTouchSupport(); // Call if Touch events detected in browser by JavaScript code ('ontouchstart' in window)
344
348
$result = $Browser->getAll($useragent);
345
349
print_r($result);
350
+
346
351
?>
347
352
```
348
353
@@ -379,12 +384,13 @@ To pasre all possible environment data and returns JSON format string:
379
384
380
385
``` php
381
386
<?php
382
- require_once('BrowserDetection.php');
387
+
383
388
$Browser = new foroco\BrowserDetection();
384
389
385
390
$useragent = 'Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Mobile Safari/537.36';
386
391
$result = $Browser->getAll($useragent);
387
392
print_r($result);
393
+
388
394
?>
389
395
```
390
396
0 commit comments