fork download
  1. <?php
  2. $limit = 150;
  3. $pokemonUrl = 'https://p...content-available-to-author-only...i.co/api/v2/pokemon/';
  4.  
  5. $ch = curl_init($pokemonUrl);
  6.  
  7. // curl_setopt($ch, CURLOPT_URL, $pokemonUrl . $i);
  8. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  9. $response = curl_exec($ch);
  10. echo curl_getinfo($ch, CURLINFO_HEADER_IN);
  11. $pokemonData = json_decode($response, true);
  12. echo $response;
  13. // for ($i = 1; $i <= $limit; $i++) {
  14. // echo "gota";
  15. // echo $pokemonData['results'][$i]['name'] . ' - ' . $pokemonData['results'][$i]['url'] . PHP_EOL;
  16. // }
  17.  
  18. ?>
  19.  
Success #stdin #stdout #stderr 0.03s 26100KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Warning:  Use of undefined constant CURLINFO_HEADER_IN - assumed 'CURLINFO_HEADER_IN' (this will throw an Error in a future version of PHP) in /home/6BRpTA/prog.php on line 10
PHP Warning:  curl_getinfo() expects parameter 2 to be int, string given in /home/6BRpTA/prog.php on line 10