@@ -14,7 +14,7 @@ This library requires PHP 5.3 or higher.
1414
1515## Manual installation
1616
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;
18182 . Connect PHP library file by using ` require_once ` :
1919
2020``` php
@@ -206,12 +206,13 @@ To detect all possible environment data use:
206206
207207``` php
208208<?php
209- require_once('BrowserDetection.php');
209+
210210$Browser = new foroco\BrowserDetection();
211211
212212$useragent = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.4150.0 Iron Safari/537.36';
213213$result = $Browser->getAll($useragent);
214214print_r($result);
215+
215216?>
216217```
217218
@@ -248,12 +249,13 @@ To parse only OS data use:
248249
249250``` php
250251<?php
251- require_once('BrowserDetection.php');
252+
252253$Browser = new foroco\BrowserDetection();
253254
254255$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';
255256$result = $Browser->getOS($useragent);
256257print_r($result);
258+
257259?>
258260```
259261
@@ -277,12 +279,13 @@ To parse only browser data use:
277279
278280``` php
279281<?php
280- require_once('BrowserDetection.php');
282+
281283$Browser = new foroco\BrowserDetection();
282284
283285$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';
284286$result = $Browser->getBrowser($useragent);
285287print_r($result);
288+
286289?>
287290```
288291
@@ -312,12 +315,13 @@ To parse only device type data use:
312315
313316``` php
314317<?php
315- require_once('BrowserDetection.php');
318+
316319$Browser = new foroco\BrowserDetection();
317320
318321$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';
319322$result = $Browser->getDevice($useragent);
320323print_r($result);
324+
321325?>
322326```
323327
@@ -336,13 +340,14 @@ To detect if mobile browser works in `Desktop Mode` use:
336340
337341``` php
338342<?php
339- require_once('BrowserDetection.php');
343+
340344$Browser = new foroco\BrowserDetection();
341345
342346$useragent = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36';
343347$Browser->setTouchSupport(); // Call if Touch events detected in browser by JavaScript code ('ontouchstart' in window)
344348$result = $Browser->getAll($useragent);
345349print_r($result);
350+
346351?>
347352```
348353
@@ -379,12 +384,13 @@ To pasre all possible environment data and returns JSON format string:
379384
380385``` php
381386<?php
382- require_once('BrowserDetection.php');
387+
383388$Browser = new foroco\BrowserDetection();
384389
385390$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';
386391$result = $Browser->getAll($useragent);
387392print_r($result);
393+
388394?>
389395```
390396
0 commit comments