1. Go to this page and download the library: Download srustamov/gcore-php 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/ */
srustamov / gcore-php example snippets
use Gcore\Client;
$gcore = new Client(apiKey: getenv('GCORE_API_KEY'));
$zone = $gcore->dns->zones->get('example.com');
echo $zone->name;
foreach ($gcore->dns->zones->list() as $zone) {
echo $zone->name, PHP_EOL;
}
$paginator = $gcore->dns->zones->list();
$firstPage = $paginator->page(limit: 20); // one page
$everything = $paginator->all(); // materialize all pages
$total = $paginator->count(); // server-reported total
$gcore->dns->zones->list(orderBy: 'name', id: [1, 2]);
// GET /dns/v2/zones?order_by=name&id=1&id=2