PHP Classes

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

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: 154 All time: 9,040 This week: 42Up
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: 5 packages by
Country: Macedonia Macedonia
Age: 40
All time rank: 13991 in Macedonia Macedonia
Week rank: 164 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 (6)  
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 (6)  /  config  
File Role Description
  Accessible without login Plain text file config-sample.php Aux. Auxiliary script

  Files folder image Files (6)  /  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 (6)  /  src  
File Role Description
  Plain text file DeviceDetails.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:154
This week:0
All time:9,040
This week:42Up