php: Get html source code with cURL

前端 未结 4 905
盖世英雄少女心
盖世英雄少女心 2020-11-27 18:26

How can I get the html source code of http://www.example-webpage.com/file.html without using file_get_contents()?

I need to know this becau

4条回答
  •  误落风尘
    2020-11-27 19:19

    Try http://php.net/manual/en/curl.examples-basic.php :)

    
    

    As the documentation says:

    The basic idea behind the cURL functions is that you initialize a cURL session using the curl_init(), then you can set all your options for the transfer via the curl_setopt(), then you can execute the session with the curl_exec() and then you finish off your session using the curl_close().

提交回复
热议问题