I have a php variable like this:
<div class="classA">
<a id="someID1"></a>
<div class="class1">
<div class="class2">
<div class="class3">
<div class="class4">
<h4>name, name<small>string</small></h4>
</div>
<div>
<h4>number<small>string</small></h4>
</div>
</div>
</div>
</div>
</div>
<div class="classA">
<a id="someID2"></a>
<div class="class1">
<div class="class2">
<div class="class3">
<div class="class4">
<h4>nameA,nameA<small>stringA</small></h4>
</div>
<div>
<h4>numberA<small>stringB</small></h4>
</div>
</div>
</div>
</div>
</div>
Now I want to get the data from h4 which is in classA with so name,name/number/stringA/stringB or something like that. How do I get this done with DOMDocument?
I don't have a clue how to do that because the only difference between these two classes is the a-tag.