PHP code example of legionth / igdb-reactphp-client

1. Go to this page and download the library: Download legionth/igdb-reactphp-client 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/ */

    

legionth / igdb-reactphp-client example snippets




$loop = React\EventLoop\Factory::create();

$httpClient = new \Legionth\React\Http\Client($loop);

$apiKey = '<enter-your-api-key>';

$igdbClient = new \Legionth\React\IGDB\IgdbClient($apiKey, $httpClient);

$promise = $igdbClient->getAchievements(array(1440, 5000));

$promise->then(function (array $array){
    echo "Array: " . json_encode($array, JSON_PRETTY_PRINT);
}, function (\Exception $exception) {
    echo $exception->getMessage();
});