テンプレートファイルを使って、htmlの出力をしようと考えています。
しかし、file_get_contents関数を使って、phpファイルをgetすると、includeやrequireも文字列になり、望んでいるファイルをtemplate.phpがインクルードできません。
何かほかに方法はございますでしょうか?
makefile.php
$contents = file_get_contents( "template.php" );
$contents = str_replace( "<%PAGETITLE>", htmlspecialchars($pagetitle), $contents);
$handle = fopen( "hoge.html", 'w');
fwrite( $handle, $contents);
template.php
<?php include( dirname(__FILE__).'/header.php' ); ?> <?php include( dirname(__FILE__).'/footer.php' ); ?>header.php
<title><%PAGETITLE></title>
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。