Hi all,
First time poster, but to be honest, I should be able to figure this one out. I just can't.
What I am looking to do is use preg_replace function to insert extra divs within an html string.
The initial string is coming from a database, but it would look something like this...
<div id="thisdiv">
[other content]
<div id="divid" class="class1 class2 targetCLass class3">
[other content]
</div>
</div>
Obviously this is a very simple version of what comes out, but it should be enough to get the idea.
What I am looking to do is to insert <div id="new_div_1"></div> and <div id="new_div_2"></div> as in the next block
<div id="thisdiv">
[other content]
<div id="divid" class="class1 class2 targetCLass class3">
[B]<div id="new_div_1"></div>[/B]
[otyher content that will include divs]
[B]<div id="new_div_2"></div>[/B]
</div>
</div>
I have been doing this using jQuery, but would prefer to do it server side if possible.
Thanks in advance, I am really stuck on this.