PHP code example of codedefective / quake-turkey

1. Go to this page and download the library: Download codedefective/quake-turkey 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/ */

    

codedefective / quake-turkey example snippets






//if you're working with the clone you should add this
y();

//All data (max 500)
$quakes->getList();

//Limited data (ex:15)
$quakes->limit(15);

//To group by location;
$quakes->groupByLocation()->getList();
//json response;
$quakes->groupByLocation()->toJson()->getList();

//To group by date;
$quakes->groupByDate()->getList();
//json response;
$quakes->groupByDate()->toJson()->getList();

//To sort by date;
$quakes->sortByDate()->getList();
//json response;
$quakes->sortByDate()->toJson()->getList();

//To sort by location;
$quakes->sortByLocation()->getList();
//json response;
$quakes->sortByLocation()->toJson()->getList();

//To sort by size;
$type = 'ml'; // default type ml (ml, md,mw)
$quakes->sortBySize($type)->getList();
//json response;
$quakes->sortBySize()->toJson()->getList();

//graph (experimental)
$quakes->limit(6)->createGraphic();
bash
# Install Composer
curl -sS https://getcomposer.org/installer | php
bash
php composer.phar 
bash
php composer.phar update