Questo è il mio HTML:Trova H3 e H4 tag sotto di esso
<h3>test 1</h3>
<p>blah</p>
<h4>subheading 1</h4>
<p>blah</p>
<h4>subheading 2</h4>
<h3>test 2</h3>
<h4>subheading 3</h4>
<p>blah</p>
<h3>test 3</h3>
Sto cercando di costruire una serie di tag h3, h4 con i tag annidati dentro di loro. Un esempio di matrice sarebbe simile:
Array
(
[test1] => Array
(
[0] => subheading 1
[1] => subheading 2
)
[test 2] => Array
(
[0] => subheading 3
)
[test 3] => Array
(
)
)
felice di usare preg_match o DOMDocument, tutte le idee?