PHP Classes

PHP User Agent Parser: Parse the user agent string to get browser details

Recommend this page to a friend!
  Info   View files Example   View files View files (9)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2016-10-01 (3 years ago) RSS 2.0 feedStarStarStarStar 62%Total: 367 All time: 6,707 This week: 313Up
Version License PHP version Categories
php-useragent 1.0.0Custom (specified...5HTTP, PHP 5, Parsers
Description Author

This class can parse the user agent string to get browser details.

It takes the user agent string of the browser eventually accessing the current site and parses it to extract several details about the user browser and computer.

The class stores the browser details in variable for the browser name and version, operating system name and version, and mobile device name if it is a mobile browser.

  Performance   Level  
Name: Ahmed Saad <contact>
Classes: 3 packages by
Country: Egypt Egypt
Age: ???
All time rank: 289628 in Egypt Egypt
Week rank: 668 Up9 in Egypt Egypt Up
Innovation award
Innovation award
Nominee: 1x

Details

PHP-UserAgent

Screen Shoot

>UserAgent Class Analayse client user agent string by default, or a given user agent string and gives you very helpfull information about user system and browser.

License

>This Work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. > Link

Copyright

>@author __Ahmed Saad__ <a7mad.sa3d.2014@gmail.com> 2013-2016

Version

> 2.0.0

Updated

> 31 Jul 2016

Features:

  1. Get System and Browser Information about your Visitor as the following: 1. Smart Phones Mobile Detecting. 2. System Archetecture ( 32bit Or 64bit ). 3. CPU Brand Detecting ( Intel, AMD, PPC ). 4. Platform Detecting for Desktop OS and Smart Phone OS. 5. Optimization : Client UserAgent Only Processed Once 6. Read Only Access Properties .

Usage:

> UserAgent Class Uses namespace, and autoload will automatically load class when called.

>> include or requireuser_agent.php* file >> >> <?php >> require_once('core/user_agent.php'); >> use Core\UserAgent; >> $instance = new UserAgent(); >> >> just require or include Suppliedautoload.php* file which will load any class >> >> <?php >> require_once('core/autoload.php'); >> use Core\UserAgent; >> $instance = new UserAgent();

$instance = new UserAgent():

>

// Current Client Systen
$instance = new UserAgent();

>

// Custom UserAgent String
$instance = new UserAgent( 'custom user agent string here' );

$instance->string:

> __String__ useragent string .

$instance->systemString:

> __String__ system string .

$instance->browserName:

> __String__ Browser Name __Google Chrome, Mozilla Firefox, Safari, Opera, Internet Explorer, Android Browser__ .

$instance->browserVersion:

> __String__ Browser Version .

$instance->osPlatform:

> __String__ OS Platform Name .

$instance->osVersion:

> __String__ OS Version .

$instance->osShortVersion:

> __String__ OS Short Version .

$instance->osArch:

> __String__ OS bit Architecture __32 OR 64__ .

$instance->isIntel:

> __Boolean__ Detect if System CPU is Intel .

$instance->isAMD:

> __Boolean__ Detect if System CPU is AMD .

$instance->isPPC:

> __Boolean__ Detect if System CPU is PowerPC .

$instance->isMobile:

> __Boolean__ Detect if client device is Mobile Phone Or Tablet .

$instance->mobileName:

> __String__ Mobile Device Name .

  Files folder image Files  
File Role Description
Files folder imagecore (3 files)
Files folder imagecss (3 files)
Accessible without login Plain text file index.php Example Example script
Accessible without login Plain text file LICENCE Lic. License text
Accessible without login Plain text file README.md Data Auxiliary data

  Files folder image Files  /  core  
File Role Description
  Accessible without login Plain text file autoload.php Aux. Auxiliary script
  Accessible without login Plain text file useragents.txt Data Documentation
  Plain text file user_agent.php Class Class source

  Files folder image Files  /  css  
File Role Description
  Accessible without login Plain text file bootstrap-theme.min.css Data Auxiliary data
  Accessible without login Plain text file bootstrap.min.css Data Auxiliary data
  Accessible without login Plain text file style.css Data Auxiliary data

 Version Control Unique User Downloads Download Rankings  
 100%
Total:367
This week:0
All time:6,707
This week:313Up
 User Ratings  
 
 All time
Utility:90%StarStarStarStarStar
Consistency:90%StarStarStarStarStar
Documentation:-
Examples:85%StarStarStarStarStar
Tests:-
Videos:-
Overall:62%StarStarStarStar
Rank:1090
  

For more information send a message to info at phpclasses dot org.