PHP code example of ducwp / gsmarena-api

1. Go to this page and download the library: Download ducwp/gsmarena-api 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/ */

    

ducwp / gsmarena-api example snippets



use FulgerX2007\GsmArena\GsmArenaApi;
pi();

$data = $gsm->getBrands();

$data = $gsm->search('zenfone');

$data = $gsm->getDeviceDetail('asus_zenfone_max_zc550kl-7476'); // Slug

print_r($data);

// Convert ARRAY to JSON
header('Content-Type: application/json');
echo json_encode($data, JSON_PRETTY_PRINT);