note 33665 added to ref.curl
| From: | php at mechintosh dot com | Date: | Thu, 03 Jul 2003 13:51:22 +0000 |
| Subject: | note 33665 added to ref.curl | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-51445@lists.php.net to get a copy of this message | ||
IMHO the example code is somewhat confusing; the fopen() and fclose() are not needed at all, AFAICT.
By default the resulting data/page of the external server is just printed out. To assign the result
of the curl session to a variable, one can use
- output buffering (see ob_start(), ob_get_contents())
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
With the latter, the result of curl_exec is the actual data instead of a boolean.
----
Manual Page -- http://www.php.net/manual/en/ref.curl.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33665
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33665&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33665&report=yes