note 102051 deleted from book.curl by danbrown
| From: | danbrown@php.net | Date: | Tue, 25 Jan 2011 13:58:35 +0000 |
| Subject: | note 102051 deleted from book.curl by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-176293@lists.php.net to get a copy of this message | ||
Note Submitter: jeffmixpute
----
a small example for getting information
by using curl
// initialise curl
$var = curl_init();
// set URL
$url="http://localhost/dataservice.php";
// set the GET options
curl_setopt($var, CURLOPT_URL, $url);
curl_setopt($var, CURLOPT_RETURNTRANSFER, true);
curl_setopt($var, CURLOPT_HTTPGET, true);
// execute response
$response = curl_exec($var);
// close curl
curl_close($var);