how can I exclude more files like branding.php? For example branding.php, about.php, contact.php.
$pages = preg_grep('/branding\.php/', glob("*.php"), PREG_GREP_INVERT);
Thx.
Use alternative in the regex:
$pages = preg_grep('/\b(?:branding|about|contact)\.php/', glob("*.php"), PREG_GREP_INVERT);
Where
\b
abranding
abc123about
(?:branding|about|contact)
branding
about
contact
Use alternative in the regex:
Where
\b
: word boundary to avoid matchingabranding
orabc123about
...(?:branding|about|contact)
: non capture group that matchbranding
ORabout
ORcontact
(you may add more files)