You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+35-4Lines changed: 35 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -12,15 +12,44 @@ Works by use only one library file and without any third-party libraries depende
12
12
13
13
This library requires PHP 5.3 or higher.
14
14
15
-
## Installation
15
+
## Manual installation
16
16
17
-
To install, you can use composer:
17
+
1. Simply upload library file `BrowserDetection.php` (placed in the `src` directory) to your project;\
18
+
2. Connect PHP library file by using `require_once`:
19
+
20
+
```php
21
+
<?php
22
+
23
+
require_once('BrowserDetection.php');
24
+
25
+
?>
26
+
```
27
+
28
+
## Installation by using Composer
29
+
30
+
Install this library using Composer:
18
31
19
32
`
20
33
composer require foroco/php-browser-detection
21
34
`
22
35
23
-
Or simply upload library file `BrowserDetection.php` (placed in the `src` directory) to your project and connect it in PHP script by using `require_once` (see usage cases bellow).
36
+
Update library package by running a command:
37
+
38
+
`
39
+
composer update foroco/php-browser-detection
40
+
`
41
+
42
+
The first step requires the Composer autoloader:
43
+
44
+
```php
45
+
<?php
46
+
47
+
require ('vendor/autoload.php');
48
+
49
+
// If you use PHP in Windows OS use another path style:
50
+
// require ('vendor\autoload.php');
51
+
?>
52
+
```
24
53
25
54
## Usage
26
55
@@ -37,7 +66,7 @@ Second argument (optional) may contain 'JSON' if you want to get returned result
37
66
38
67
```php
39
68
<?php
40
-
require_once('BrowserDetection.php');
69
+
41
70
$Browser = new foroco\BrowserDetection();
42
71
43
72
$useragent = $_SERVER['HTTP_USER_AGENT'];
@@ -62,6 +91,8 @@ Just use second argument of methods as 'JSON'
0 commit comments