Good day! There is an html page filled with the following content:
<a name="00:00:00" href="#00:00:00" class="ts">[00:00:00]</a> <span class="mn"><Nick></span> " Шаблон " <br> Using simple_html_dom , you need to check the entire page and find a match with the filter.
foreach($html->find('a.ts, span.mn, text') as $body => $value) { $iText = "Шаблон"; if (strpos($value, $iText) !== false) { echo "Find it."; echo $value."<br>Nick: "; echo $value->find('span')->plaintext."<br>"; } } This code example displays the found text by pattern. I need to capture in addition to the text also <span> with a nickname, and <а> with a date. I would be grateful for the hint how to do it right! Thank you very much!
text, and when you find one thatprev_sibling, then throughprev_siblingyouprev_siblingfind the correspondingaandspan. - teran