Forum Moderators: coopster
I was hoping that i could simply 'echo' out the php code info my file variable and save it, but its not quite comming out at expected.
ob_start();
echo "TEST <? $siteHeadersFooters->displayTop($headersArray,$hideLangSwitch=true); ?>";
$page = ob_get_clean();
$fullPath='/home/www/docs/test.php';
$fh = fopen($fullPath, 'w') or die("can't open file");
fwrite($fh, $page );
fclose($fh);
Results as the following in the php file:
TEST <? (Array,=true); ?>
I can understand what is happening, I just cant figure out how to make it pass that php code as PHP.
Any help would be greatly appreciated