I have read a few posts on similar issues but not managed to find myself an answer.
I have a template.php file and what I want to do with it is make an identical copy (this includes any php code in that file) make a few changes and save it as a seperate page.
heres what I have so far:
<?php
$data = file_get_contents("template.php");
$data = str_replace("blogpostidhere", $postid, $data);
file_put_contents($postid.".php", $data);
?>
The file i need gets created but it doesnt contain anything from between the php tags. It is pure html. Is there a way around this as my template.php is set to simply be copied and a single variable (blogpostidhere) to be added to make the page work. it needs php though?