I want to create an informer to display news headlines from a news page and I want to make sure that not only everything on the page is displayed, but only one specific title tag.
1 answer
I do not know how well it is, but it is very easypage1.php
$mode="only_news"; include('page2.php');
page2.php
global $mode; if ($mode=='only_news') { ... } else { ... };
If page2.html
static, then something like this
$text=file_get_contents('page2.html'); $news=preg_match_all("div class=news(.*?)\/div", $text, $result);
If page2.html
dynamic, it can be something like this
$text=file_get_contents('http://mysite.com/page2.html'); $news=preg_match_all("div class=news(.*?)\/div", $text, $result);
|