PHP Classes
elePHPant
Icontem

pharaoh PHP Client Detection: Detect the current HTTP request browser type

Recommend this page to a friend!
  Info   View files Documentation   View files View files (6)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2020-02-27 (1 month ago) RSS 2.0 feedNot yet rated by the usersTotal: 57 This week: 5All time: 9,678 This week: 89Up
Version License PHP version Categories
pharaoh-client 1.0.0Custom (specified...5HTTP, PHP 5, Wireless and Mobile
Description Author

This class can detect the current HTTP request browser type

It parses the current HTTP request user agent to detect relevant details. Currently it can determine:

- If the browser is on a mobile phone, tablet or on a computer
- The operating system running on the browser
- IP address
- Supported languages

Name: Moamen Eltouny <contact>
Classes: 7 packages by
Country: Egypt Egypt
Age: 27
All time rank: 413148 in Egypt Egypt
Week rank: 92 Up2 in Egypt Egypt Up
Innovation award
Innovation award
Nominee: 2x

 

Details

[PHP] Pharaoh Client

Latest Stable Version Total Downloads License

Pharaoh-Client provides a quick and easy controlling of Client Information [Visitor]

Install

Install the latest version using Composer:

$ composer require raggitech/pharaoh-client

then include the vendor autoload file.

Usage

Getting the Instances:

$client = \Pharaoh\Client::getInstance();

<a name="client"></a>

Client


##############################
# Bot
##############################
// check if it's a bot
var_dump($client->isBot());

// get the bot's name
echo $client->bot();

##############################
# Main Information
##############################

// get user agent
echo $client->agent;

// get user ip
echo $client->ip;

// get referer
echo $client->referer;

// get user languages list
echo $client->languages;

// get user language
echo $client->language;

// get user language's variant
echo $client->variant;

##############################
# Device
##############################
$device = $client->device;

// Browser Engine name
echo $device->name; // WebKit

// Browser (name, version)
echo $device->browser->name; // Chrome
echo $device->browser->version; // 77.0.3865.120

// Platform (name, version)
echo $device->platform->name; // Windows
echo $device->platform->version; // 10.0


// Device Type
var_dump($device->isDesktop); // true

// if it's a phone
if($device->isPhone){
    var_dump(
        $device->isMobile, // true
        $device->isTablet, // false
        
        $device->isiOS, // true
        $device->isAndroid, // false
    );
}

License

MIT license

  Files folder image Files  
File Role Description
Files folder imagesrc (2 files)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  src  
File Role Description
  Plain text file Agent.php Class Class source
  Plain text file Client.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:57
This week:5
All time:9,678
This week:89Up