php手册上就有 http://www.php.net/manual/en/function.curl-setopt.php <?php // create a new cURL resource $ch = curl_init();// set URL and other appropriate options curl_setopt($ch, CURLOPT_URL, "http://www.example.com/"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);// grab URL and pass it to the browser echo curl_exec($ch);// close cURL resource, and free up system resources curl_close($ch); ?>
echo file_get_contents('http://www.yd-jxt.com');
http://www.php.net/manual/en/function.curl-setopt.php
<?php
// create a new cURL resource
$ch = curl_init();// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, "http://www.example.com/");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);// grab URL and pass it to the browser
echo curl_exec($ch);// close cURL resource, and free up system resources
curl_close($ch);
?>