<?php
function curl_get_file_contents ($url) {
$content = FALSE;
if (function_exists("curl_init")) {
$handle = curl_init();
curl_setopt($handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($handle, CURLOPT_CONNECTTIMEOUT, 3);
curl_setopt($handle, CURLOPT_URL, $url);
$content = curl_exec($handle);
curl_close($handle);
} else {
die("CURL nepalaikomas");
}
return $content;
}
set_time_limit(0);
$fp = fopen("log.txt", "a+");
$html = curl_get_file_contents("http://www.simplehtmlguide.com/examples/helloworld.html");
fwrite($fp, trim($html) . "\r\n");
fclose($fp);
?>