I have this html code:
<marquee align="left" id="LatestNewsM" SCROLLAMOUNT="4" loop="infinite" direction="right">
<font dir="rtl" valign="top" class="StringTheme" style="font-size:14px;">test test test</font>
<img src="/Portal/images/LightVersionWeb2/jazeeraTicSep.gif" align="middle">
<font dir="rtl" valign="top" class="StringTheme" style="font-size:14px;">test sample text sample</font>
<img src="/Portal/images/LightVersionWeb2/jazeeraTicSep.gif" align="middle">
<font dir="rtl" valign="top" class="StringTheme" style="font-size:14px;">text text 222 another text</font>
<img src="/Portal/images/LightVersionWeb2/jazeeraTicSep.gif" align="middle">
...........
.....
</marquee>
and this PHP code:
$homepage = file_get_contents('http://www.site.com');
How I can search in the content and get only the text inside Font tag <font>
Will be useful:
http://php.net/manual/en/function.strip-tags.php – to delete all tags from text
http://php.net/manual/en/book.simplexml.php – to parse XML
If HTML will be valid (currently not – ‘img’ tags not closed), something like this can be used: