i see in the curl_setopt() documentation that you can set a callback function to display the progress of a curl_exec. There's not much said on how the callback function is used. Does anyone know? I'd just like to output the percentage of the file which has been downloaded to STDOUT. Thanks.
This is how the callback looks in C:
typedef int (*curl_progress_callback)(void *clientp,
double dltotal,
double dlnow,
double ultotal,
double ulnow);
Probably in PHP it should look like
curl_progress_callback($clientp, $dltotal, $dlnow, $ultotal, $ulnow)
I suppose that dl stands for download and ul for upload.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With