diff --git a/examples/download_file_with_callback.php b/examples/download_file_with_callback.php index 689cd9f..e0d2123 100644 --- a/examples/download_file_with_callback.php +++ b/examples/download_file_with_callback.php @@ -5,7 +5,7 @@ use \Curl\Curl; $curl = new Curl(); $curl->download('https://php.net/images/logos/php-med-trans.png', function($instance, $tmpfile) { - $save_to_path = '/tmp/_' . basename($instance->url); + $save_to_path = '/tmp/' . basename($instance->url); $fh = fopen($save_to_path, 'wb'); stream_copy_to_stream($tmpfile, $fh); fclose($fh); diff --git a/examples/set_url_1.php b/examples/set_url_1.php new file mode 100644 index 0000000..75977e9 --- /dev/null +++ b/examples/set_url_1.php @@ -0,0 +1,18 @@ +get(array( + 'q' => $q, + 'page' => $i, + )); +} diff --git a/examples/set_url_2.php b/examples/set_url_2.php new file mode 100644 index 0000000..2591672 --- /dev/null +++ b/examples/set_url_2.php @@ -0,0 +1,19 @@ +setURL('https://www.example.com/search'); + +for ($i = 1; $i <= $pages; $i++) { + // https://www.example.com/search?q=coffee&page=N + $curl->get(array( + 'q' => $q, + 'page' => $i, + )); +}