mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-24 02:49:27 +00:00
13 lines
348 B
PHP
13 lines
348 B
PHP
<?php
|
|
require __DIR__ . '/vendor/autoload.php';
|
|
|
|
use \Curl\Curl;
|
|
|
|
$curl = new Curl();
|
|
$curl->download('https://secure.php.net/images/logos/php-med-trans.png', function($instance, $tmpfile) {
|
|
$save_to_path = '/tmp/' . basename($instance->url);
|
|
$fh = fopen($save_to_path, 'wb');
|
|
stream_copy_to_stream($tmpfile, $fh);
|
|
fclose($fh);
|
|
});
|