In the below code when i replace the <mainContent> i dont want it to just echo the ID i want the inlude file include that is added by the ID, however i also dont want it to just add the file right at the top of the page which it is dont now, how can i achive this?
<?php
// load the content of the TEMPLATE and VARS file
$template = implode( "" , file( "template.php" ) );
require("incs/vars.php");
//Date format
if ($dateFormat == "1") {$date = date("F jS Y");}
//Add MAIN content files
if (empty($_GET["id"])) {$_GET["id"] = "1";}
if ($_GET["id"] == "1") {include("incs/home.php");}
if ($_GET["id"] == "2") {include("incs/about.php");}
// Replace the code
$template = str_replace( "<date>" , $date , $template );
$template = str_replace( "<mainContent>" , $_GET["id"] , $template );
// Print the TEMPLATE file
echo $template;
?>