PHP Classes

PHP Device Info Details: Get the details of device using the php.mk API

Recommend this page to a friend!
  Info   View files Example   View files View files (6)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog (1)    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 151 This week: 1All time: 9,066 This week: 560Up
Version License PHP version Categories
device-data 1GNU General Publi...5HTTP, PHP 5, Web services
Description 

Author

This package can get the details of device using the php.mk API.

It can take the current user agent string and send a HTTP request to the php.mk API Web server to perform a query about the details of the current device that the user is using to access the server on which PHP is running.

The class decodes the API response with the device details and returns it decoded to the calling application.

Innovation Award
PHP Programming Innovation award nominee
October 2020
Number 8
Many applications need to adapt the presentation of their Web pages according to the capabilities of the device that the users may be using to access those pages.

There are many types of devices with varied number of screen characteristics. Having updated information on the characteristics of each device that may access your site pages, is a complex problem.

This package provides a simplified solution by accessing to an API made available from php.mk site that can return the known characteristics of a given device.

Manuel Lemos
Picture of Mihajlo Siljanoski
  Performance   Level  
Name: Mihajlo Siljanoski <contact>
Classes: 6 packages by
Country: Macedonia Macedonia
Age: 39
All time rank: 14021 in Macedonia Macedonia
Week rank: 106 Up1 in Macedonia Macedonia Equal
Innovation award
Innovation award
Nominee: 1x

Example

<?php

   
require_once '../config/config.php';
    require_once
'../src/DeviceDetails.php';
   
   
$device = new DeviceDetails($config['token']);

   
$deviceData = $device->getDevice();

    if (
$device->errors()) {
       
print_r($device->errors());
    } else {
       
print_r($deviceData);
    }

?>


  Files folder image Files  
File Role Description
Files folder imageconfig (1 file)
Files folder imageexamples (2 files)
Files folder imagesrc (1 file)
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  config  
File Role Description
  Accessible without login Plain text file config-sample.php Aux. Auxiliary script

  Files folder image Files  /  examples  
File Role Description
  Accessible without login Plain text file advanced.php Example Example script
  Accessible without login Plain text file simple.php Example Example script

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

 Version Control Unique User Downloads Download Rankings  
 100%
Total:151
This week:1
All time:9,066
This week:560Up