PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
As you've probably guessed, this returns nothing and tells me the function doesn't exist. Is there any way in php to include this remote file and return the array from the remote file to a local array, allowing me to use the contents of the array in a local script?
EDIT - Make sure you expand the first PHP code, the function "test" is in there.
Also, what you are including is the OUTPUT of blah.php. When you server makes the call over to blah.php, that server runs the script.
Form the docs:
When a file is included, parsing drops out of PHP mode and into HTML mode at the beginning of the target file, and resumes again at the end. For this reason, any code inside the target file which should be executed as PHP code must be enclosed within valid PHP start and end tags.
If "URL fopen wrappers" are enabled in PHP (which they are in the default configuration), you can specify the file to be included using a URL (via HTTP or other supported wrapper - see List of Supported Protocols/Wrappers for a list of protocols) instead of a local pathname. If the target server interprets the target file as PHP code, variables may be passed to the included file using a URL request string as used with HTTP GET. This is not strictly speaking the same thing as including the file and having it inherit the parent file's variable scope; the script is actually being run on the remote server and the result is then being included into the local script.
It is still missing the point that test.php will NOT know that the function test() exists. it is not defined anywhere in test.php and when you include blah.php it is the same as including a local file that is blank, as it does NOT output any code for test.php to include.
blah.php executes on its server, not on the server with test.php.
Ah yes, exactly ...
Well ... ben you can then rename your external page in .txt and you parses this page in your script php. But in this case, everyone can see this page .txt