How do I get all the TITLE and LINKS reading from a file ?
A sample content of the file below
<tr class="odd">
<td align="left" valign="top" class="text_cont_normal"> TITLE </td>
<td align="left" valign="top" class="normal_text_link">
<img border="0" onclick="javascript:window.location.href='LINK'" style="cursor: pointer;" alt="Download" src="btn.jpg"/></td>
</tr>
<tr class="even">
<td align="left" valign="top" class="text_cont_normal"> TITLE2 </td>
<td align="left" valign="top" class="normal_text_link">
<img border="0" onclick="javascript:window.location.href='LINK2'" style="cursor: pointer;" alt="Download" src="btn.jpg"/></td>
</tr>
I tried
$tags = $doc->getElementsByTagName('img');
foreach ($tags as $tag) {
if ($tag->hasAttribute('onclick'))
echo $tag->getAttribute('onclick').'<br>';
}
But not getting the data which I actually want !