File tree Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -27,38 +27,42 @@ composer require unicframework/user-agent
2727``` php
2828use UserAgent\UserAgent;
2929
30+ // Parse current request user agent
3031$user = new UserAgent();
3132
32- //Get client ip address
33+ // Parse custom user agent string
34+ $user = new UserAgent($_SERVER['HTTP_USER_AGENT']);
35+
36+ // Get client ip address
3337echo $user->ip;
3438
35- //Get client os
39+ // Get client os
3640echo $user->os;
3741
38- //Get client os version
42+ // Get client os version
3943echo $user->osVersion;
4044
41- //Get client browser
45+ // Get client browser
4246echo $user->browser;
4347
44- //Get client browser version
48+ // Get client browser version
4549echo $user->browserVersion;
4650
47- //Get client device type (Phone, iPhone, Computer)
51+ // Get client device type (Phone, iPhone, Computer, etc. )
4852echo $user->deviceType;
4953
50- //Get client device brand name
54+ // Get client device brand name (Apple, Samsung, Lenovo, etc.)
5155echo $user->deviceBrand;
5256
53- //Get client referrer
57+ // Get client referrer
5458echo $user->referrer;
5559
56- //Check client is referred or not
60+ // Check client is referred or not
5761if($user->isReferred) {
5862 //Client is referred
5963}
6064
61- //Get client user agent
65+ // Get client user agent
6266echo $user->userAgent;
6367```
6468
You can’t perform that action at this time.
0 commit comments