Re: transforming an HTML Comment in a HTML TAG
| From: | Romulo Roberto Pereira | Date: | Mon, 15 Jan 2001 03:35:35 +0000 |
| Subject: | Re: transforming an HTML Comment in a HTML TAG | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-34552@lists.php.net to get a copy of this message | ||
This is a nice idea but would not be more efficient if I substitute the
entire block like this:
this is what I have in the database:
<!-- TEXT -->ANY TEXT<!-- TEXT -->
this is what I want:
<!-- TEXT -->ANY TEXT <a href="edittext.php?pageid=X"><img
src="images/edit_buttom.gif"></a><!-- TEXT -->
what youl be a REGEX to substitute that block for this one above?
Thank you,
Rom
> Then, you get your complete text into $buffer and just:
>
> <?
> $endtag = "<!-- TEXT ENDS -->";
> $imgtag = " <a href='edittext.php?pageid=X'>"
> ."<img src='images/edit_buttom.gif'></a>";
> $output = ereg_replace($endtag, $imgtag.$endtag, $buffer);
> ?>
>
> Jason Murray