To do this, you can use the file_get_contents function:
$content = file_get_contents('url/filepath here'); echo $content;
Note. . If you want to read from a secure protocol, such as https, make sure you have the openssl extension from php.ini.
Update:
From what you are saying, I suspect that you have disabled the allow_url_fopen settings from the php.ini file, you need to enable this in order to read the urls.
Update 2:
It seems you didn’t provide the correct URL, I just checked, for example, if you just entered www.google.com , it works fine:
$url = 'http://www.google.com'; $content = file_get_contents($url); echo $content;
source share