note 96313 added to function.curl-setopt
| From: | starosielec at googlemail dot com | Date: | Fri, 19 Feb 2010 23:07:59 +0000 |
| Subject: | note 96313 added to function.curl-setopt | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-166198@lists.php.net to get a copy of this message | ||
You can use also use object methods as callback functions. This is usefull if your curl ressource is
part of an object handling transfers.
Instead of curl_setopt($curl, CURLOPT_WRITEFUNCTION, "curl_handler_recv") you can use
array($object, "method") as value for callback options.
For example:
class downloader {
private $curl;
function __construct() {
$this->curl = curl_init();
curl_setopt($this->curl, CURLOPT_WRITEFUNCTION, array($this,
"curl_handler_recv"));
}
function curl_handler_recv($res, $data) {
...
}
...
}
----
Server IP: 69.147.83.197
Probable Submitter: 78.50.59.86
----
Manual Page -- http://www.php.net/manual/en/function.curl-setopt.php
Edit -- https://master.php.net/note/edit/96313
Del: integrated -- https://master.php.net/note/delete/96313/integrated
Del: useless -- https://master.php.net/note/delete/96313/useless
Del: bad code -- https://master.php.net/note/delete/96313/bad+code
Del: spam -- https://master.php.net/note/delete/96313/spam
Del: non-english -- https://master.php.net/note/delete/96313/non-english
Del: in docs -- https://master.php.net/note/delete/96313/in+docs
Del: other reasons-- https://master.php.net/note/delete/96313
Reject -- https://master.php.net/note/reject/96313
Search -- https://master.php.net/manage/user-notes.php