我要从一个网页上获取他所有的信息如:http://www.yd-jxt.com上面的信息,求一个完整的过程!我是菜鸟  越详细越好!

解决方案 »

  1.   


    echo file_get_contents('http://www.yd-jxt.com');
      

  2.   

    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);
    ?>