I'm stuck on a Simple HTML Dom question...
For each <table>
on my webpage I'd like to scan the <table>
and check if there is an <a>
inside of it. If there is, then echo the first <tr>
and <a>
else skip and go on to the end <table>
.
I started working on it but I'm unsure how to progress or check if there is a <a>
in the table...
foreach ($html->find('table') as $name) {
foreach ($name->find('a') as $elem) {
echo $elem->plaintext.'<br>';
}
}
Any ideas?