Chris Andrews
asked on
replace last occurrence of a string with another string
arrgh...
Ok, I'm trying to find a way to get the last ending p tag </p> and place a string in front of it.
So:
$string = "<p>Some text</p><p>More text.<p/><p>Even more text.</p>";
$insert = " Here is an insert.";
results need to be:
---------
<p>Some text</p><p>More text.<p/><p>Even more text. Here is an insert.</p>
-----------
Help would be greatly appreciated - this has been quite a headache!
Ok, I'm trying to find a way to get the last ending p tag </p> and place a string in front of it.
So:
$string = "<p>Some text</p><p>More text.<p/><p>Even more text.</p>";
$insert = " Here is an insert.";
results need to be:
---------
<p>Some text</p><p>More text.<p/><p>Even more text. Here is an insert.</p>
-----------
Help would be greatly appreciated - this has been quite a headache!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER