I need to split my html based on a custom html tag.
This is how my html looks like:
<div>
<div id="header">
<h1>Document Title</h1>
</div>
<div id="content">
<p>Lorem ipsum dolar sit</p>
<magicheader type="2" class="someClass">Header</magicheader>
<p>Lorem ipsum dolar sit</p>
<span><magicheader type="3" class="someClass">Header</magicheader></span>
</div>
<div id="footer">
</div>
</div>
This is what I need:
Array
(
[0] => <div>
<div id="header">
<h1>Document Title</h1>
</div>
<div id="content">
<p>Lorem ipsum dolar sit</p>
[1] => <magicheader type="2" class="someClass">Header</magicheader>
[2] => <p>Lorem ipsum dolar sit</p>
<span>
[3] => <magicheader type="3" class="someClass">Header</magicheader>
[4] => </span>
</div>
<div id="footer">
</div>
</div>
)
Can anybody help me with the pattern?