Skip to content

ramtin2025/gsmarena-API

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GSM Arena API (gsmarena.com)

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


Usage:

<?php

// Include class gsm.php
require("gsm.php");

// Create objek
$gsm = new gsm();

Brands:

$data = $gsm->getBrands();

Search:

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

Detail:

$data = $gsm->detail('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);

About

cURL and return Array or JSON

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%