Not the answer to the question, but to the title (PHP in_array wildcard match):
function in_array_wildcards(string $needle, array $haystack, bool $case_insensitive = true):bool {
foreach ($haystack as $value) {
if (strpos($value, '*') !== false) {
if ((bool)preg_match('/' . str_replace('*', '(.*)', $value) . '/' . (($case_insensitive) ? 'i' : ''), $needle)) {
return true;
}
}
else {
if ($case_insensitive) {
if (strtolower($value) == strtolower($needle)) {
return true;
}
}
else {
if ($value == $needle) {
return true;
}
}
}
}
return false;
}
Works perfectly for
if (!in_array_wildcards($sFile, array('.htaccess', 'config.php', 'dbfs.php', 'error.php', 'front_content.php*', 'front_crcloginform.inc.php', 'index.php', 'robots.txt'))) {
('front_content.php*' finds front_content.php, front_content.php.sic, front_content.php.s01, ...)
strposfor example or read about regular expressions andpreg_*functions