I hope someone can help me. I am using PHP Simple HTML DOM Parser (http://simplehtmldom.sourceforge.net/manual.htm) successfully, but now I am trying to find elements based on a specific name. For example, the selected HTML may contain tags such as:
<p class="mattFacer">Matt Facer</p>
<p class="mattJones">Matt Jones</p>
<p class="daveSmith">DaveS Smith</p>
What I need to do is read in this HTML and grab any HTML elements that match anything, starting with the word "matte"
I tried
$html = str_get_html("http://www.testsite.com");
foreach($html->find('matt*') as $element) {
echo $element;
}
but it does not work. It does not return anything.
Can this be done? I basically want to search for any HTML element containing the word "matte". It can be span, div or p.
I'm here in a dead end!
source
share