This is what I'd do :
<?php
$template = "
<b>%[header]%</b><br>
<p>%[content]%</p>
Author : <i>%[author]%</i><br>
";
$var[header] = "The output";
$var[content] = "This is the content with <html&;gt;";
$var[author] = "Jacob K. Hansen";
$output = $template;
while(list($index, $value) = each($var)) {
$output = str_replace("%[".$index."]%", $value, $output);
}
echo $output;
?>