https://github.com/olegkoval/php-user_info
PHP class to get information about the site visitor (IP, reverse DNS, referer, OS, etc...)
https://github.com/olegkoval/php-user_info
php userinfo visitor-tracking website-visitors
Last synced: 6 months ago
JSON representation
PHP class to get information about the site visitor (IP, reverse DNS, referer, OS, etc...)
- Host: GitHub
- URL: https://github.com/olegkoval/php-user_info
- Owner: olegkoval
- Created: 2013-05-11T08:55:58.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2017-08-01T22:50:52.000Z (almost 9 years ago)
- Last Synced: 2025-10-25T18:42:03.852Z (8 months ago)
- Topics: php, userinfo, visitor-tracking, website-visitors
- Language: PHP
- Size: 5.86 KB
- Stars: 29
- Watchers: 3
- Forks: 21
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
php-user_info
=============
PHP class to get information about the website visitor (IP, reverse DNS, referer, OS, etc...)
Installation
-----------
Use Composer to install the library:
```
composer require olegkoval/php-user-info
```
Usage
-----
1) Include file with UserInfo class in your project:
```
require_once('/UserInfo.php')
```
2) Create UserInfo object:
```
$UserInfo = new UserInfo();
```
3) Call methods to get info about the website visitor:
* $UserInfo->getIP() - get IP of visitor
* $UserInfo->getReverseDNS() - get Reverse DNS of visitor
* $UserInfo->getCurrentURL() - get current URL
* $UserInfo->getRefererURL() - get Referer URL
* $UserInfo->getDevice() - get Device type (PC/iPad/iPhone/etc...) of visitor
* $UserInfo->getOS() - get OS of visitor
* $UserInfo->getBrowser() - get Browser type of visitor
* $UserInfo->getLanguage() - get Browser Language of visitor
* $UserInfo->getCountryCode() - get Country Code of visitor
* $UserInfo->getCountryName() - get Country Name of visitor
* $UserInfo->getRegionCode() - get Region Code of visitor
* $UserInfo->getRegionName() - get Region Name of visitor
* $UserInfo->getCity() - get City of visitor
* $UserInfo->getZipcode() - get Zipcode of visitor
* $UserInfo->getLatitude() - get Latitude of visitor
* $UserInfo->getLongitude() - get Longitude of visitor
* $UserInfo->isProxy() - check if connection was through proxy
Requirements
------------
1) Browscap
[http://www.php.net/manual/en/misc.configuration.php#ini.browscap](http://www.php.net/manual/en/misc.configuration.php#ini.browscap)
2) cURL
[http://php.net/manual/en/book.curl.php](http://php.net/manual/en/book.curl.php)
Creator
------------
[Oleg Koval](http://github.com/olegkoval)
[@olegkoval](http://twitter.com/olegkoval)