PHPackages                             lexinzector/aboutguest - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. lexinzector/aboutguest

ActiveLibrary

lexinzector/aboutguest
======================

User information in PHP - IP, browser, operating system, robot

1.0(2y ago)03MITPHPPHP &gt;=5.6.0

Since Oct 17Pushed 2y ago1 watchersCompare

[ Source](https://github.com/lexinzector/aboutguest)[ Packagist](https://packagist.org/packages/lexinzector/aboutguest)[ RSS](/packages/lexinzector-aboutguest/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

AboutGuest
==========

[](#aboutguest)

User information in PHP - IP, browser, operating system, robot

Provides
--------

[](#provides)

- browser name
- browser version
- operating system name
- operating system version/kernel
- visitor IP
- check: whether the user has logged in from a browser
- check: whether the user is logged in from a mobile device
- name of brand/OS/browser of mobile phone, smartphone, tablet
- check: whether the visitor is a search engine robot
- which search engine does the robot belong to

How the PHP class works to determine visitor data by user-agent
---------------------------------------------------------------

[](#how-the-php-class-works-to-determine-visitor-data-by-user-agent)

From the arrays folder, associative arrays are loaded that contain abbreviations or short names of browsers, operating systems or robots that appear in the user-agent line that we receive from the browser. After receiving the data, all methods that have the set\_ prefix are dynamically called and fill the class variables, because only they are public and can be taken out of the scope of the class.

Requirements
------------

[](#requirements)

PHP &gt;= 5.6.0

Installation
------------

[](#installation)

run in console:

```
composer require lexinzector/aboutguest

```

Methods
-------

[](#methods)

```
$this->load($file_and_array_name)
```

Loader. This method loads arrays from the arrays folder and assigns them to the variable specified in the value of the $file\_and\_array\_name attribute, this attribute is also the name of the file from the arrays folder.

```
$this->set_ip()
```

Returns a value from the $\_SERVER array with the REMOTE\_ADDR key, as you know $\_SERVER\['REMOTE\_ADDR'\] is the user's IP that is accessible to the browser.

```
$this->set_browser()
```

array file: arrays / browsers.php After the $this-&gt;load method has loaded the arrays, this method will work with the array from the $this-&gt;browsers object. Once it finds a match between the array key and the contents of the string in $this-&gt;agent, it assigns the $this-&gt;browser object the value of the key in the $this-&gt;browsers array. Also, this method also assigns the browser version in $this-&gt;version. Since the browser has already found a match, there is no doubt that the user came from the browser and did not access the site through a script. Set $this-&gt;is\_browser to True;

```
$this->set_operating_system()
```

array file: arrays / operating\_systems.php It works in the same way as the $this-&gt;set\_browser method, except that it uses the $this-&gt;operating\_systems object as an array to check for a match, which received the array from the arrays/operating\_systems.php file after executing the $this-&gt;load() method. Unfortunately, browsers are not so active in dealing with the version of the operating system and sometimes you can get strange numbers instead of the version. So be careful when you use $this-&gt;os\_version. The name of the operating system is contained in $this-&gt;operating\_system (not to be confused with $this-&gt;os\_version)

```
$this->set_robot()
```

array file: arrays / robots.php We check if the site visitor is not a search engine robot. If he is a robot then the value for $this-&gt;is\_robot will be TRUE; the value $this-&gt;robot will contain the name of the search engine that launched the robot on the site (Google Bot, Yandex Bot, Rambler Bot...)

```
$this->set_mobile()
```

array file: arrays / mobiles.php It works similarly to the $this-&gt;set\_operating\_system() method, only it assigns the name of the phone brand to the $this-&gt;mobile object and the value of $this-&gt;is\_mobile will be TRUE if logged in from a mobile phone, smartphone or tablet.

Example
-------

[](#example)

```
use \Lexinzector\AboutGuest\AboutGuest;

// useragent autodetection
$AboutGuest = new AboutGuest;
// custom useragent
$useragent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36';
$AboutGuest = new AboutGuest($useragent);

echo 'User Agent: ' . $AboutGuest->agent . '';
echo 'IP: ' . $AboutGuest->ip . '';
echo 'Browser: ' . $AboutGuest->browser . '';
echo 'Browser version: ' . $AboutGuest->version . '';
echo 'Operating System: ' . $AboutGuest->operating_system . '';
echo 'OS version: ' . $AboutGuest->os_version . '';
echo 'I am a robot? ' . $AboutGuest->is_robot . '';
echo 'Robot belongs: ' . $AboutGuest->robot . '';
echo 'Logged in from a mobile phone? ' . $AboutGuest->is_mobile . '';
echo 'Mobile phone: ' . $AboutGuest->mobile . '';
```

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

936d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f9e76799f10722789c09d428daf6f85f97be0485c90e27ac7a8031fb542c710a?d=identicon)[lexinzector](/maintainers/lexinzector)

---

Top Contributors

[![lexinzector](https://avatars.githubusercontent.com/u/10235341?v=4)](https://github.com/lexinzector "lexinzector (2 commits)")

---

Tags

phpbrowseruseragentIPoperating systemrobot

### Embed Badge

![Health badge](/badges/lexinzector-aboutguest/health.svg)

```
[![Health](https://phpackages.com/badges/lexinzector-aboutguest/health.svg)](https://phpackages.com/packages/lexinzector-aboutguest)
```

###  Alternatives

[jenssegers/agent

Desktop/mobile user agent parser with support for Laravel, based on Mobiledetect

4.8k67.8M440](/packages/jenssegers-agent)[whichbrowser/parser

Useragent sniffing library for PHP

1.8k11.6M50](/packages/whichbrowser-parser)[foroco/php-browser-detection

Ultra fast PHP library to detect browser, OS, platform and device type by User-Agent parsing

1554.7M7](/packages/foroco-php-browser-detection)[donatj/phpuseragentparser

Lightning fast, minimalist PHP UserAgent string parser.

60417.1M60](/packages/donatj-phpuseragentparser)[thadafinser/user-agent-parser

UserAgent parsing done right http://useragent.mkf.solutions/

249316.9k2](/packages/thadafinser-user-agent-parser)[whichbrowser/server

Useragent sniffing server for Javascript

426.2k](/packages/whichbrowser-server)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
