Preview: curl2.php
Size: 556 B
/home/godevadmin/www/admin/braintree/final/curl2.php
<?php
/**
* Initialize the cURL session
*/
$ch = curl_init();
/**
* Set the URL of the page or file to download.
*/
curl_setopt($ch, CURLOPT_URL,
"http://news.google.com/news?hl=en&topic=t&output=rss’");
/**
* Create a new file
*/
$fp = fopen("rss.xml", "w");
/**
* Ask cURL to write the contents to a file
*/
curl_setopt($ch, CURLOPT_FILE, $fp);
/**
* Execute the cURL session
*/
curl_exec ($ch);
/**
* Close cURL session and file
*/
curl_close ($ch);
fclose($fp);
?>
Directory Contents
Dirs: 7 × Files: 11