note 91952 added to function.curl-setopt
| From: | xektrum at gmail dot com | Date: | Thu, 02 Jul 2009 16:14:56 +0000 |
| Subject: | note 91952 added to function.curl-setopt | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-157833@lists.php.net to get a copy of this message | ||
As of php 5.3 CURLOPT_PROGRESSFUNCTION its supported here's how:
<?php
function callback($download_size, $downloaded, $upload_size, $uploaded)
{
// do your progress stuff here
}
$ch = curl_init('http://www.example.com');
// This is required to curl give us some progress
// if this is not set to false the progress function never
// gets called
curl_setopt($ch, CURLOPT_NOPROGRESS, false);
// Set up the callback
curl_setopt($ch, CURLOPT_PROGRESSFUNCTION, 'callback');
// Big buffer less progress info/callbacks
// Small buffer more progress info/callbacks
curl_setopt($ch, CURLOPT_BUFFERSIZE, 128);
$data = curl_exec($ch);
?>
Hope this help.
----
Server IP: 200.24.234.70
Probable Submitter: 200.72.15.195
----
Manual Page -- http://www.php.net/manual/en/function.curl-setopt.php
Edit -- https://master.php.net/note/edit/91952
Del: integrated -- https://master.php.net/note/delete/91952/integrated
Del: useless -- https://master.php.net/note/delete/91952/useless
Del: bad code -- https://master.php.net/note/delete/91952/bad+code
Del: spam -- https://master.php.net/note/delete/91952/spam
Del: non-english -- https://master.php.net/note/delete/91952/non-english
Del: in docs -- https://master.php.net/note/delete/91952/in+docs
Del: other reasons-- https://master.php.net/note/delete/91952
Reject -- https://master.php.net/note/reject/91952
Search -- https://master.php.net/manage/user-notes.php