I have this code:
include('./simplehtmldom/simple_html_dom.php');
$url = "http://www.turismovenezia.it/Dove-Alloggiare/1322597142.html";
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// grab URL and pass it to the browser
$output = curl_exec($ch);
//close connection
curl_close($ch);
but I’m not getting anything as output..I expected the code of the page ($url).
Any idea?
Javi
Never use file_get_contents for a remote file, it is slow, inefficient, CPU intensive. Use Curl or fsocket instead… fsocket being the better of of the two.