<?php
$url = 'http://vnexpress.net/tin-tuc/phap-luat/15-canh-sat-bi-bat-giu-tai-my-duc-duoc-tha-tu-do-3571959.html';
echo $url."\n";
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT ,5); //timeout in seconds
curl_setopt($ch, CURLOPT_TIMEOUT, 5); //timeout in seconds
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$result = curl_exec($ch);
if(curl_exec($ch) === false)
{
echo 'Curl error: ' . curl_error($ch);
}
else
{
var_dump($result);
}
preferences:
57.2 ms | 402 KiB | 5 Q