【发布时间】:2014-09-09 13:54:48
【问题描述】:
而不是将 content.php 中的 PHP 代码输出到浏览器:
<?php
include 'content.php';
如何让执行结果不输出到浏览器而是写入本地文本文件:
<?php
include 'content.php';
// not output to browser
// but grab the results and write them to content.txt
如何做到这一点?
【问题讨论】:
-
使文件返回一个变量并将该变量写入文件。
-
我想你想要
ob_get_contents
标签: php