umm, i dunno really, like i put in the first post would there be anyway to just add the code where the coment is here and then run it in the replace string, say its the date inside the function.
<?php
$template = implode( "" , file( "template.php" ) );
//The Code within the "fuctions" goes here
$template = str_replace( "<newcode>" , $functioncode , $template );
echo $template;
?>