2

まず、a) ばかげた質問をしていないことを願っています.b) これはまだカバーされていません..

プロジェクトの場合、顧客の Web サイト用に CMS システム (基本) の形式を作成していますが、file_get_contents() を使用してエコーすると、php タグが含まれる生の html が返されます。

私が間違っていることに誰かが光を当てることができますか?

<?php

require_once( "system/functions.php" );
require_once( "registeredModules.php" ); 
include "system/PageGenerator.php";

$includes = array( "pagePreamble"=>"pageData/index_pagePreamble.inf",
                   "headContents"=>"pageData/index_headContents.inf",
                   "bodyPreamble"=>"pageData/index_bodyPreamble.inf",
                   "contents"=>"pageData/index_contents.inf" );

$pageTitle = "Hook and Odiham Lions";

$html = file_get_contents( $template );

... other processing here....

print $html;

?>
4

1 に答える 1

0

テンプレートファイルを開くには、次のコードを試すことができます。

function read_data_file( $file ) {
            $file_open = fopen( $file , 'r' );
            $file_data = fread( $file_open , filesize( $file ) );
            fclose( $file_open );

            return $file_data;
        }

使用法:

$html = read_data_file( $template );
于 2013-08-11T13:40:44.053 に答える