Overview: I'm making a tempting system for my sites, which at the moment is going quite well and it is working how I would expect it to, the only problems arise when I would like something like {PAGE_SIDEBAR} to show the file template/sidebar.php or something similar.
I am using
//loads of other str_replace here
$body = str_replace("{PAGE_SIDEBAR}, include("template/sidebar.php"), $body);
echo $body;
this works, however it includes the file at the start of body, NOT where {PAGE_SIDEBAR} is. Where the tag is, it shows the number 1.
See screenshots for better explanation:
How the rendered template looks before
Also, for point of interest, How it looks using file_get_contents() instead of include(): http:// www.jamesmoorhouse.co.uk/stack_overflow/str_replace/file_get_contents_method.png
Ideally I Am hoping for it to work as it would with the include method, but show up where the file_get_contents method puts it.