Regular expression to replace html

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
wlaarman
Forum Newbie
Posts: 1
Joined: Mon Nov 15, 2004 2:39 am

Regular expression to replace html

Post by wlaarman »

Hi,

I am creating a site with a lot of pages with (almost) the same content, and a lot of pictures on it. I want to make it easy to change these pictures for a selected group of people. For example, by replacing my html-code:

Code: Select all

<a href="./test.html"><IMG SRC="./images/white.gif" width=127 height=98 name="" border=0 style="display:block;"></a>
by:

Code: Select all

url:<INPUT TYPE="TEXTFIELD" VALUE="./test.html"><INPUT type=file>width:<INPUT TYPE="TEXTFIELD" VALUE="127">height:<INPUT TYPE="TEXTFIELD" VALUE="98">
or something like that. My question is, can this easy be done using a regular expression, or another way, and does someone know a script that already does something like that...

Thanks in advance,

Willem
Post Reply