Well, I've been happily hacking away, and came up with the following:
$file = ("template_email");
$text = "";
for ($i = 0; $i < count($file); $i++) {
while (ereg("\$([[:alnum:]]*)", $mail[$i], $regs)) {
$file[$i] = str_replace($regs[0], ${$regs[1]}, $file[$i]);
}
}
And in the end, the array $file contains the original file, with variables replaced by the values of the variables.
Maybe anybody out here knows a faster solution? (Or maybe, distantly maybe, someone else has a use for this? :-)
Greetings,
Vincent