I have a script that needs to get one string of information from a remote script that is stored in a PHP file. But I don't know how to include or read remote files. Can anyone help?
Do you need to get the output of that remote php file, or the source itself? If you just need the output you can just use include and the url to the file:
PHP Code:
include "http://example.com/file.php";
If you need to access the source code or you otherwise cannot access it via url then you need to read up on php ftp functions: http://us3.php.net/ftp
The code NullPointer referenced might not work in some web hosts. Also, if you need to assign the output to a variable rather than just printing it, include can be a problem.
You're more likely to be able to use get_file_contents(). This tutorial describes how to do that, as well as an alternative if that's not supported.