开发者

How to receive data of an HTTPS website in a string PHP?

开发者 https://www.devze.com 2023-01-22 08:28 出处:网络
开发者_如何学GoIs there a function to which you give the URL of a website and it returns back the source in a string?Yes,
开发者_如何学Go

Is there a function to which you give the URL of a website and it returns back the source in a string?


Yes,

  • file_get_contents — Reads entire file into a string. A URL can be used as a filename with this function if the fopen wrappers have been enabled.

Example:

file_get_contents('https://www.example.com');

Otherwise cURL and HTTP will do.

If you want to parse the contents on the page, you will likely want use a DOM Parser instead.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号