curl_exec
curl_exec
Perform a cURL session
**curl_exec** CurlHandle $handle
Execute the given cURL session.
This function should be called after initializing a cURL session and all the options for the session are set.
On success, this function flushes the result directly to the
and returns true, return.falseforfailure.
However, if the
option is , it will return
the result on success, false on failure.
stdout``CURLOPT_RETURNTRANSFERset
Opmerking: > Note that response status codes which indicate errors (such as ) are not regarded as failure. can be used to check for these.
404 Not found``curl_getinfo
Voorbeeld: Fetching a web page
<?php
// create a new cURL resource
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, "http://www.example.com/");
curl_setopt($ch, CURLOPT_HEADER, 0);
// grab URL and pass it to the browser
curl_exec($ch);
?>
curl_multi_exec