Skip to content

Commit 9af2b9d

Browse files
committed
Update README.md
1 parent d04b47b commit 9af2b9d

File tree

1 file changed

+35
-4
lines changed

1 file changed

+35
-4
lines changed

README.md

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,44 @@ Works by use only one library file and without any third-party libraries depende
1212

1313
This library requires PHP 5.3 or higher.
1414

15-
## Installation
15+
## Manual installation
1616

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:
1831

1932
`
2033
composer require foroco/php-browser-detection
2134
`
2235

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+
```
2453

2554
## Usage
2655

@@ -37,7 +66,7 @@ Second argument (optional) may contain 'JSON' if you want to get returned result
3766

3867
```php
3968
<?php
40-
require_once('BrowserDetection.php');
69+
4170
$Browser = new foroco\BrowserDetection();
4271

4372
$useragent = $_SERVER['HTTP_USER_AGENT'];
@@ -62,6 +91,8 @@ Just use second argument of methods as 'JSON'
6291
// Get all possible environment data (JSON):
6392
$result = $Browser->getAll($useragent, 'JSON');
6493

94+
print_r($result);
95+
6596
// ... etc
6697
?>
6798
```

0 commit comments

Comments
 (0)