PHP code example of tcgdex / sdk
1. Go to this page and download the library: Download tcgdex/sdk 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/ */
tcgdex / sdk example snippets
use TCGdex\TCGdex;
// Is you are using your own PSRs implementations add theses before loading the class
TCGdex::$cache = /* PSR16 CacheInterface */;
TCGdex::$requestFactory = /* PSR17 RequestFactoryInterface */;
TCGdex::$responseFactory = /* PSR17 ResponseFactoryInterface */;
TCGdex::$client = /* PSR18 ClientInterface */;
// initialize the SDK with the language
$tcgdex = new TCGdex("en");
// Fetch the cards !
$card = $tcgdex->fetchCard('1', 'Sword & Shield');