Is there a function to which you give the URL of a website and it returns back the source in a string?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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:
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.