If support for "URL fopen-wrapper / wrapper" is enabled when configuring PHP (unless you explicitly gave the flag - disable-url-fopen-wrapper to configure (for versions newer than 4.0.3) or not set allow_url_fopen to off in the file php.ini (for newer versions)), you can use HTTP and FTP-URLs with most functions that take a filename / filename as a parameter, including - operators require () and include ().
Note: Windows-version of PHP currently does not support remote file access for the following functions: include (), include_once (), require () require_once ().
For example, you can use it to open a file on a remote web-server, parse the output data and then use these data in a query to the database, or just put them in the style of your web-site.
Example: Getting the name / title remote page
You can also write to files via FTP, if you are connected as a user with the correct access rights and if the file does not exist yet. To connect as any user other than 'anonymous', you must specify a username (and possibly, password) in the URL, such as: 'ftp://user:password @ ftp.example.com / path / to / file' . (You can use the same syntax to access files via HTTP, if necessary Basic-authentication.)
Example: Storing data on a remote server
Note: this example you may have the idea to use this technique to write to a remote log, but, as stated above, you can only record a new file using shell URL fopen (). To perform a distributed loginga like this, you should see syslog ().