Fetching a URL with cURL : curl_init « String « PHP






Fetching a URL with cURL

 
<?php
$c = curl_init('http://www.example.com/robots.txt');
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
$page = curl_exec($c);
curl_close($c);
?>
  
  








Related examples in the same category

1.Writing a response body to a file with cURL