Load and parse a webpage using 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
MasterArtist
Forum Newbie
Posts: 3
Joined: Fri Sep 28, 2007 5:53 am

Load and parse a webpage using PHP

Post by MasterArtist »

Hi all,

Im looking to load an external webpage into a DOM using PHP.


I had thought a possible solution could be


$source = "http://www.test.com";
$dom = new DomDocument();
$dom->load($source);

but this dosnt appear to work.

any ideas or alternative suggestions?

Thanks
EricS
Forum Contributor
Posts: 183
Joined: Thu Jul 11, 2002 12:02 am
Location: Atlanta, Ga

Post by EricS »

That is MOSTLY correct.

It's DOMDocument, not DomDocument.

But the rest is correct.
Post Reply