I have a html snippet that looks like this (of course surrounded by other html):
Header:
Tex
This is untested, but you might be looking for simple_html_doms next_sibling()
method.
$html->find('p[class=finfot3]')->next_sibling()->innertext()
should return the contents of the second <p>
element.
preg_match('~<p>(.*)</p>~', $html, $matches);
var_dump($matches);
Find the p element with the class. Then use
where $e
is the element with the class.
For better alternatives to SimpleHtmlDom, see Best Methods to parse HTML