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 : word boundary to avoid matching abranding or abc123about ...(?:branding|about|contact) : non capture group that match branding OR about OR contact (you may add more files)