Get data from a URL in PHP

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
dbishop
Forum Newbie
Posts: 1
Joined: Wed May 15, 2002 3:06 pm
Location: Midwest USA

Get data from a URL in PHP

Post by dbishop »

Within PHP I need to send a request to a URL and get the resonse as a string that I can parse. My hosting service has sockets disabled wo I can't do it in that manner.

A sample request would look like:
$result = request_function("http://www.myurl.com?param1=abc&[aram2=123");

$result would contain the contents of the page formed by the request.

Doug
jmarcv
Forum Contributor
Posts: 131
Joined: Tue Jul 29, 2003 7:17 pm
Location: Colorado

Post by jmarcv »

fread()
You can use a url as well as a file. The html will be returned.
Post Reply