I need a function/class/or some kind of sophisticated find/ replace solution for this problem
Have a huge form with lot of:
1: input tags like this one
<input id="Id" name="Id" class="element text large" value="" type="text" />
which needs to be "changed/replaced" to this one
<div class="element text large" id="username"><?php echo $username_var; ?> </div>
(NOTE: input tag has more elements than DIV tag EG(value, type,name ))
2: also labels to div
<label class="description" for="username"><?php echo $username; ?></label>
to
<div class="description"><?php echo $username; ?></div>
(NOTE: label tag has one more elements than DIV tag Eg(for)).
Any help is greatly appreciated