PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Muhammad Umer Farooq   PHP User Information Class   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP User Information Class
Get details of the user accessing the current page
Author: By
Last change: Update index.php
Date: 5 years ago
Size: 579 bytes
 

Contents

Class file image Download
<?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);