I think the ! might have an effect on the regexp interpretter... it's easy
enough to escape it (\!) though.

--Toby

----- Original Message -----
From: "Jason Murray" <[EMAIL PROTECTED]>
To: "'Romulo Roberto Pereira'" <[EMAIL PROTECTED]>; "php-general"
<[EMAIL PROTECTED]>
Sent: Sunday, January 14, 2001 10:24 PM
Subject: RE: [PHP] transforming an HTML Comment in a HTML TAG


> > So, before the end HTML comment I would like to add an image.
> > How do I do that?
>
> The first thing I suggest you do is use a comment for starting and a
> comment for ending - this makes it all a LOT easier to parse.
>
> Start: <!-- TEXT STARTS -->
> End:   <!-- TEXT ENDS -->
>
> Then, you get your complete text into $buffer and just:
>
> <?
>    $endtag = "<!-- TEXT ENDS -->";
>    $imgtag = "&nbsp;<a href='edittext.php?pageid=X'>"
>             ."<img src='images/edit_buttom.gif'></a>";
>    $output = ereg_replace($endtag, $imgtag.$endtag, $buffer);
> ?>
>
> ... or something similar. Not sure if < or > or ! play havoc with a
> regex or not...
>
> If you can't change your start and end comments to be unique, then
> you'll have to just do the ereg_replace on every second one.
>
> Jason
>
> --
> Jason Murray
> [EMAIL PROTECTED]
> Web Design Team, Melbourne IT
> Fetch the comfy chair!
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to