here's an idea in pseudocode:
// assign $start_tag and $end_tag ie {[placeholder]}
$start_tag = '{[';
$end_tag = ']}';
// put content of template into $str using fopen, ob_get_contents, whatever...
// function to replace placeholders
function stuff($placeholder_name,$value) {
global $str,$start_tag,$end_tag;
$pattern = $start_tag . $placeholder_name . $end_tag;
$replacement = $value;
$str = preg_replace("/$pattern/",$replacement,$str);
}
I would think there's already a way to do this if you're using someone's template script...