查找php文件中出现的所有必需的和包含的


find all occurrences of required and included in a php file

我知道preg_match_all可以给我这些信息。我需要

include("xxxx");
include_once("xxxx");
require("xxxx");
require_once("xxxx");

以及我可能不知道的PHP允许的任何其他排列。

没有太多的运气建立表达。

试试这个:

(include|require)(_once)?[( ]["'].+["']')?;

但我不会依赖RegEx来做这种工作。