![]() |
|
|
+ Search |
![]()
|
Feb 19th, 2008 22:02
dman, Praveen Kumar Kukkapalli, Philip Olson, sanket gupta, http://www.ttnr.org
Simple way is to use file() function
$file_content = file("http://sturly.com/supporters.php");
It will return an array.
More information can be found at http://in2.php.net/file
Check out the following :
PHP Manual : Chapter 20. Using remote files
http://www.php.net/manual/features.remote-files.php
Examples exist for both FTP and HTTP Methods. Also, note the include
function :
PHP Manual : Include()
http://www.php.net/manual/function.include.php
Include can also include remote files although has a few conditions
such as :
1. URL fopen wrappers must be enabled (they are by default)
2. Can't include() remote files when using the windows OS
The above manual entries contain more detailed information on these
topics and includes links/information about related functions. Here
are a few examples :
include 'http://www.php.net/';
If you need it as a variable, try :
$remote_site = implode(file('http://www.lsyg.com/'),'');
If you've already opened it with fopen() :
$fp = fopen('http://www.pmoj.com/','r');
fpassthru($fp);