The website that I'm developing uses a "header" and "footer" template. These templates are included on each page of the site. The header template opens the HTML and contains the complete head tag, and then opens the body tag. The footer template closes the body tag and then closes the HTML. The basic structure is as follows:
<?php
//Set the current page name so it can be highlighted in the menu bar
$page="Home";
//For page-specific HEAD includes
$headincludes=array("<some type of code>","<some other type of code>");
include("/assets/template/header.php");
?>
<!--START PAGE CONTENT-->
<!--END PAGE CONTENT-->
<?php
include("/assets/template/footer.php");
?>
The header template dumps the "headincludes" array into the head section of the page as so:
foreach ($headincludes as $toecho)
echo $toecho;
This method works fine for things such as javascript, but when I try to add a PHP statement, it ends up as unparsed PHP in the final page served to the browser. Is there some special method to echoing PHP with PHP?
$headincludesarray?<?php ?>tags?