Jump to content

Possible To Load In External HTML Pages?


undyboy91

Recommended Posts

Is it possible in a PHP script to load in an external webpage, analyze it and then display parts of that page? For example like a PHP script that suppose loads in the contents of say the main forum page here and displays the name of all the topics on that page by extracting the topic names from the HTML page.
Link to comment
https://forums.phpfreaks.com/topic/27730-possible-to-load-in-external-html-pages/
Share on other sites

Of course. You can get the file into a variable using [url=http://php.net/file_get_contents]file_get_contents[/url], then, if your lucky enough and the document is xhtml complient you could parse it with [url=http://php.net/simplexml]simplexml[/url], otherwise, its a pretty complex job to do it using regular expressions.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.