【发布时间】:2013-08-25 23:05:33
【问题描述】:
我想制作一个生成html页面并创建文件来存储每个页面的cms。
理想情况下我需要这样的东西:
<?php
$file1 = get_produced_html_from('mainPage.php');
/* write the file to a directory*/
$file2 = get_produced_html_from('ProductsPage.php');
/* write the file to a directory*/
?>
有没有我错过的函数,而不是 require、include、require_once、include_onse 等?
澄清一下:我不需要 .php 文件中的 php 代码。我只需要 html 内容,这意味着应该首先执行 php 文件。
您是否认为解决方案类似于通过将http://domain.com/templates/mainPage.php 读取为html 流来使用http://php.net/manual/en/function.file-get-contents.php?
非常感谢。
【问题讨论】:
-
有 fwrite 或 file_put_contents 可以写入内容,如果您正在寻找的话。
-
但是要从文件中获取内容,是的,您可以使用
file_get_contents然后从变量中回显内容,或者您可以使用 CURL。 -
我认为你们走错了路,伙计们。
-
@burzum 我想我当时可能误解了这个问题。你对 OP 有什么想法?
-
@Fred-ii-:我将其解读为,“我如何获得
mainPage.php会生成的 HTML?”
标签: php html content-management-system