Via Cà Matta 2 - Peschiera Borromeo (MI)
+39 02 00704272
info@synaptica.info

PHP cURL

Digital Innovation Partner

PHP cURL

// initialize cURL
$ch = curl_init();

//  set the URL of the remote resource to download
curl_setopt($ch, CURLOPT_URL, 'http://www.site.com/index.html');
//set url as curl_init() parameter --> $ch = curl_init('http://www.site.com/index.html');

// required that no headers be downloaded
curl_setopt($ch, CURLOPT_HEADER, 0);

// prevent remote content from being passed to print
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// set the timeout to 10 seconds
curl_setopt($ch, CURLOPT_TIMEOUT, 10);

//  run the call and save the result in a variable
$output = curl_exec($ch);

// close cURL
curl_close($ch);