Page 1 of 1

PHP as a spider

Posted: Tue Jun 29, 2004 5:41 pm
by Calimero
Can PHP open URL - file on distant website to view its source (HTML particularly)

Just whicf function to use
fopen()
file_read() //or how it is called

Any comments or suggestions - SHOOT (me)

Thanks Ahead !

Posted: Tue Jun 29, 2004 5:44 pm
by markl999
Lots of functions can, such as file_get_contents() and file(). If you just want the entire remote site in a string then i'd use file_get_contents()

See http://php.net/stream for more info on the stream 'enabled' functions.

Posted: Tue Jun 29, 2004 6:06 pm
by evilmonkey
Funny how I just asked the same thing. :) file_gets_contents works for this purpose.