[PHP] Getting Contents of Webpage

Got questions? Got answers? Go here for both.

Moderator: MaxCoderz Staff

Post Reply
KevinJB
Calc Wizard
Posts: 501
Joined: Sat 28 May, 2005 5:34 am
Location: Chesapeake, Virginia
Contact:

[PHP] Getting Contents of Webpage

Post by KevinJB »

I'm pretty sure there is a function to do this already but Google was absolutely no help what-so-ever. I just need something that will return a string containing the contents of a webpage (the HTML basically). How would I go about doing this, or does anyone know how what the built-in function is (if there is one)?
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
KevinJB | RevSoft
KevinJB
Calc Wizard
Posts: 501
Joined: Sat 28 May, 2005 5:34 am
Location: Chesapeake, Virginia
Contact:

Post by KevinJB »

Wow, I need to wait a bit before I go begging for help. After much searching through the PHP documentation I found the function's name is 'file_get_contents(string url)', in case anyone else is wondering.
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
KevinJB | RevSoft
Andy_J
Calc Master
Posts: 1110
Joined: Mon 20 Dec, 2004 10:01 pm
Location: In the state of Roo Fearing
Contact:

Post by Andy_J »

I think you can just fopen/fread it, too. :)
ImageImage
Image
KevinJB
Calc Wizard
Posts: 501
Joined: Sat 28 May, 2005 5:34 am
Location: Chesapeake, Virginia
Contact:

Post by KevinJB »

Lot quicker this way though :)
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
KevinJB | RevSoft
User avatar
KermMartian
Calc Wizard
Posts: 549
Joined: Tue 05 Jul, 2005 11:28 pm
Contact:

Post by KermMartian »

See how helpful it is to JFGI? :)
Image Image Image
KevinJB
Calc Wizard
Posts: 501
Joined: Sat 28 May, 2005 5:34 am
Location: Chesapeake, Virginia
Contact:

Post by KevinJB »

but Google was absolutely no help what-so-ever.
See how helpful it is to read? :)
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
KevinJB | RevSoft
Post Reply