Forum Moderators: coopster
This is probably a really simple question for you people, but its giving me issues!
I've got a few paragraphs of text that look like:
<p>text text text text text text</p><p>text text text text text text</p><p>text text text</p> .....etc
Now I want to replace each <p> with say <p class="test"> for example. This is fine, so I get:
<p class="test">text text text text text text</p>
<p class="test">text text text text text text</p>
<p class="test">text text text</p>
Now what I want is the last occurance of <p class="test"> changed back to <p>. I'm probably doing this is completely the wrong order or something but I can't get this is work! I've tried strrchr, substr_replace, str_replace etc but nothing - am I missing something really simple or being stupid? :)
Thanks to anyone who can advise!