PHP code example of balambasik / deviceinfo

1. Go to this page and download the library: Download balambasik/deviceinfo library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

balambasik / deviceinfo example snippets

 


lambasik\DeviceInfo\DeviceInfo;

$devInfo = new DeviceInfo();

print_r($devInfo->getInfo());

 


lambasik\DeviceInfo\DeviceInfo;

$devInfo = new DeviceInfo();

print_r($devInfo->getInfo(DeviceInfo::ASSETS_BASE64)); // icons base64
// print_r($devInfo->getInfo(DeviceInfo::ASSETS_URL)); // icons URLs
// print_r($devInfo->getInfo(DeviceInfo::ASSETS_ALL)); URLs and base64


use Balambasik\DeviceInfo\DeviceInfo;

$devInfo = new DeviceInfo("Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0", "4.4.4.4");

print_r($devInfo->getInfo(DeviceInfo::ASSETS_BASE64));




alambasik\DeviceInfo\DeviceInfo;

$devInfo = new DeviceInfo();

$info = $devInfo
    ->setIP("4.4.4.4")
    ->setUserAgent("Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0")
    ->getInfo(DeviceInfo::ASSETS_BASE64);

print_r($info);




alambasik\DeviceInfo\DeviceInfo;

print_r(DeviceInfo::list());