我尝试的代码是:
example.php
function test()
{
echo "Function is called";
}
test_include.inc
include_once("example.php");
test();
@arun-kumar,你应该在test_include中声明这个函数。Inc .并将其包含在example.php中。example.php是将要执行的文件。但是你也可以在另一个php文件中包含一个php文件或者在另一个inc文件中包含一个inc文件