我有3个不同的文件 -如何在php中处理include_once循环?
fileMainIncludeEverywhere.php
... include_once('fileMinorInclude.php'); ?>
fileMinorInclude.php
... include_once('fileMainIncludeEverywhere.php'); ...
fileToRun.php
... include_once('fileMainIncludeEverywhere.php'); ...
我有很多的文件像fileToRun.php。
目前我没有在我的代码中遇到任何错误,但我想知道是否有任何情况下会失败?
不会有错误。你应该在发布SO之前阅读手册 - https://secure.php.net/manual/en/function.include-once.php。我认为这很清楚? – spinkus
当你测试它时发生了什么? – symcbean
@S。Pinkus我已经阅读了手册,它写道,如果文件已包含在内,它将不会再被包含。但就我而言,该文件甚至没有被包含一次。 – xRahul