Search code examples
phpremote-file-inclusion

Opening remote file using PHP


I have a PHP page where i want to open a file on a remote machine and read its contents. I have to specify the remote machine's IP address. How can this be done in PHP ?


Solution

  • echo file_get_contents("http://1.1.1.1/file.txt")