PHP Classes

PHP User Information Class: Get details of the user accessing the current page

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 227 All time: 8,188 This week: 673Up
Version License PHP version Categories
php-userinfo-class 1.0.5MIT/X Consortium ...5HTTP, PHP 5, User Management
Description 

Author

This class can get details of the user accessing the current page.

It checks the current request variable values to retrieve relevant information about the user accessing the page that is served by the current script. Currently it can retrieve:

- Get user computer IP address and operating system name and version
- Get user browser name and version

Picture of Muhammad Umer Farooq
Name: Muhammad Umer Farooq <contact>
Classes: 52 packages by
Country: Pakistan Pakistan
Innovation award
Innovation award
Nominee: 6x

Example

<?php

require_once 'Classes/UserInfo.php';

$info = new UserInfo();

$osName = $info->operatingSystem();
$osVersion = $info->osVersion();
$browserName = $info->browser()['browser'];
$browserVersion = $info->browserVersion();
$ip = $info->ip();
$isMobile = $info->isMobile();

$data = [
   
'Operating System Name' => $osName,
   
'Operating System Version' => $osVersion,
   
'Browser Name' => $browserName,
   
'Browser Version' => $browserVersion,
   
'Ip address' => $ip,
   
'Is Mobile' => $isMobile,
];
var_dump($data);


Details

PHP UserInfo Class

PHP UserInfo Class

Feature

- Get user ip. - Get user Browser Name. - Get user Browser Version. - Get user Operating System Name. - Get user Operating System Version. - Check is user from mobile.


  Files folder image Files (4)  
File Role Description
Files folder imageClasses (1 file)
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 Doc. Documentation

  Files folder image Files (4)  /  Classes  
File Role Description
  Plain text file UserInfo.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:227
This week:0
All time:8,188
This week:673Up