I've been looking into this for some hours now and have read countless posts here on Stackoverflow and through Google. I've also read up on a few PHP methods and am studying up on some Regex but am not sure on the best method. Here's what I'm trying to achieve:
I have some simple title tags in an hgroup like so:
<hgroup>
<h1>Title</h1>
<h2>Subtitle</h2>
</hgroup>
Please note, the hgroup may have a class
as well.
I need to search my page for the hgroup tag (with the possible class) and add some code on a new line becoming
<hgroup>
<span>NEW LINE AND TEXT</span>
<h1>Title</h1>
<h2>Subtitle</h2>
</hgroup>
I've found a few solutions to find a class or tag but am not sure how to add a new line of code successfully between.