I want to retrieve the HTML code of a link (web page) in PHP. For example, if the link is
https://stackoverflow.com/questions/ask
then I want the HTML code of the page which is served. I want to retrieve this HTML code and store it in a PHP variable.
How can I do this?
If your PHP server allows url fopen wrappers then the simplest way is:
If you need more control then you should look at the cURL functions: