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
Paddy
Forum Contributor
Posts: 244 Joined: Wed Jun 11, 2003 8:16 pm
Location: Hobart, Tas, Aussie
Contact:
Post
by Paddy » Tue Jul 06, 2004 5:26 am
Ok, I am not even sure if this can be done but I would be happy if it could.
I need a function so I can grab the text of a given URL so that I can manipulate it. Ideally I would like it to be placed in a string. So...
$somestring = somefunc("
http://www.someurl.com ");
Any ideas?
markl999
DevNet Resident
Posts: 1972 Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)
Post
by markl999 » Tue Jul 06, 2004 5:29 am
Code: Select all
$somestring = file_get_contents('http://www.someurl.com');
(also see
http://php.net/file if you want each line of the remote site as an element of an array)
Paddy
Forum Contributor
Posts: 244 Joined: Wed Jun 11, 2003 8:16 pm
Location: Hobart, Tas, Aussie
Contact:
Post
by Paddy » Tue Jul 06, 2004 7:31 am
Which is pretty much why I absolutely love this site.
Thanks heaps Mark.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Tue Jul 06, 2004 9:58 am
if you don't have URL wrappers on, for whatever reason. You will need something like [php_man]curl[/php_man]