PHP code example of williamn / pokeapi-php

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

    

williamn / pokeapi-php example snippets




use Pokeapi\Client;

// Default to v2, if you want to call v1 use Client('v1')
$client = new Client();
$pokemon = $client->get('berry', 1);