This array takes input from a form and inserts it in a template:
$fields_to_parse=array("string1","string2","string3");
while (list($null,$field)=each($fields_to_parse)) {
$template=str_replace("[[".$field."]]",strip_tags($_POST[$field]),$template);
}
So if I enter 'Foo' into <input name="string1">, then in the template [[string1]] is replaced with 'Foo'.
How do I acheive the same effect with variables instead of form input?
I want to be able to replace [[string1]] with $string1.
Thanks.