mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-18 20:11:45 +00:00
20 lines
353 B
PHP
20 lines
353 B
PHP
<?php
|
|
|
|
require __DIR__ . '/../vendor/autoload.php';
|
|
|
|
use Curl\Curl;
|
|
|
|
// Retrieve first N pages of search results.
|
|
$pages = 10;
|
|
$q = 'coffee';
|
|
|
|
$curl = new Curl('https://www.example.com/search');
|
|
|
|
for ($i = 1; $i <= $pages; $i++) {
|
|
// https://www.example.com/search?q=coffee&page=N
|
|
$curl->get([
|
|
'q' => $q,
|
|
'page' => $i,
|
|
]);
|
|
}
|