Newbie needs help
| From: | John Taylor-Johnston | Date: | Thu, 07 Jan 2010 08:16:59 +0000 |
| Subject: | Newbie needs help | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-300869@lists.php.net to get a copy of this message | ||
$content = "... a bunch of text with some <!--protected-->protected information<!--/protected--> with some more text with some more <!--protected--><table><tr><td>more protected text</td></tr></table><!--/protected--> and even <!--protected--><b>some protected content>b><!--/protected-->";
I want to replace any content between these tags:
<!--protected--><!--/protected-->
with say
$replacewith = "<strong>protected content</strong>";
$content = " a bunch of text with some <strong>protected content</strong> with some more text with some more <strong>protected content</strong> and even <strong>protected content</strong>";
It's a little more involved than str_replace which is about the limit of my knowledge.
Any takers - to take pity on me? I'm trying to figure out some funky WordPress stuff as it is.
John