Is it possible to stop including a php file?

前端 未结 3 742
醉梦人生
醉梦人生 2020-12-06 10:22

Is it possible to stop the inclusion of a file in the middle of a file?

For example, one file would contain:

include(\'home.php\');

3条回答
  •  爱一瞬间的悲伤
    2020-12-06 10:53

    In place of break, use return:

    return

    If called from the global scope, then execution of the current script file is ended. If the current script file was include()ed or require()ed, then control is passed back to the calling file.

提交回复
热议问题