Page 1 of 1

Load and parse a webpage using PHP

Posted: Fri Sep 28, 2007 6:00 am
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

Posted: Fri Sep 28, 2007 7:44 am
by EricS
That is MOSTLY correct.

It's DOMDocument, not DomDocument.

But the rest is correct.