Page 1 of 1

Reading certain parts of a webpage with file_get_contents()

Posted: Thu Aug 03, 2006 11:39 pm
by greenking
Hello, I am trying to create a php script that will open a URL and then take certain things off of that webpage. I dont want the whole page, just some of the information on it.

I'm using, and it is working:

$handle = file_get_contents("url");
echo $handle;

But I do not know where to go from here, how do I get the pieces of information I need?

Thanks.

Posted: Thu Aug 03, 2006 11:46 pm
by feyd
substr() and preg_match(), among others, can be used to pull out pieces from the resulting string.

I hope you have permission to pull information. If the site offers an RSS feed, maybe the information you seek is in there.