ducwp/gsmarena-api

GsmArena API

Installs: 11

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 48

Type:project

v1.6 2020-01-13 14:48 UTC

This package is auto-updated.

Last update: 2024-05-12 07:04:32 UTC


README

PHP Class for grab data on gsmarena.com website and output Array or JSON using cURL and simple html dom.

Usage:

use FulgerX2007\GsmArena\GsmArenaApi;
require_once 'vendor/autoload.php';

// Create object
$gsm = new GsmArenaApi();

Brands:

$data = $gsm->getBrands();

Search:

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

Detail:

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

Return Array:

print_r($data);

Return JSON:

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