【发布时间】:2011-05-22 21:22:08
【问题描述】:
有什么方法可以检查通过include('to_include.php') 包含的文档是否返回了任何内容?
看起来是这样的:
//to_include.php
echo function_that_generates_some_html_sometimes_but_not_all_the_times();
//main_document.php
include('to_include.php');
if($the_return_of_the_include != '') {
echo $do_a_little_dance_make_a_little_love_get_down_tonight;
}
因此,在我的主文档中包含to_include.php 之后,我想检查包含的文档是否生成了任何内容。
我知道显而易见的解决方案是在main_document.php 中使用function_that_generates_some_html_sometimes_but_not_all_the_times(),但这在我当前的设置中是不可能的。
【问题讨论】: