Hi,
I'm trying to replace all instances of
<input type=text name="some_variable" size="30">
with
<input type=text name="some_variable" value=$some_variable size="30">
where "$some_variable" is the value of $somevariable and not literally "$some_variable".
I've tried this code:
echo preg_replace ("/(<input)(.)(name=\")(\w)/e", "$1$2$3$4\" value=$\4 ", $contents);
but I'm getting an error: Fatal error: Failed evaluating code: $some_variable
any ideas on how I can fix this, or where I'm going wrong?
Thanks