PHP as a spider

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!

Moderator: General Moderators

Post Reply
User avatar
Calimero
Forum Contributor
Posts: 310
Joined: Thu Jan 22, 2004 6:54 pm
Location: Milky Way

PHP as a spider

Post 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 !
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post 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.
User avatar
evilmonkey
Forum Regular
Posts: 823
Joined: Sun Oct 06, 2002 1:24 pm
Location: Toronto, Canada

Post by evilmonkey »

Funny how I just asked the same thing. :) file_gets_contents works for this purpose.
Post Reply