file_get_contents输出目标的 php 而不是先执行它时出错


error with file_get_contents outputting php of target instead of executing it first

嗨,我有一个文件,我正在使用file_get_contents来获取另一个php文件 - 目标文件应该运行一些php并输出一个HTML表,如果我只是在浏览器中加载它,它就会这样做,但是当我使用file_get_contents检索它时,检索的是php代码,而不是html表。

我应该使用与file_get_contents不同的东西吗?

我应该使用什么?

使用include("文件名.php")代替file_get_contents

file_get_contents用于返回文件内容的 jut。