I want to use a template file, where i am using {value} as markers to replace that with a value.
The variable is set like $order and I want to replace it in the template where there is {order}.
There are about 50 of these variables I want to replace.
Is there a way to do this automaticly?
$text = file_get_contents("bol_files/order_template.txt");
$text = str_replace("{ordernummer}",$bestelnummer, $text);
$text = str_replace("{verzendwijze}",$verzendwijze, $text);
echo $text;
str_replace can take arrays as arguments:
where $replaceArray is an associative array