linux - 云代码空间
——
$ch = curl_init(); // set URL and other appropriate options curl_setopt($ch, CURLOPT_URL, "http://www.baidu.com"); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FILETIME, true); // grab URL $output = curl_exec($ch); // Print info echo '<pre>'; print_r (curl_getinfo($ch)); echo '</pre>';