Your array currently has only one element, which is a long string:
'.js, .pl, .py, .rb, .css, .php, etc.'
You should quote each of your string elements like this:
$exclusions = array('.js', '.pl', '.py', '.rb', '.css', '.php', 'etc.');
Try changing your code to this:
$excluded = 'no';
if ($code !== 'yes'){
$exclusions = array('.js', '.pl', '.py', '.rb', '.css', '.php');
foreach($exclusions as $exclude){
$check = strripos($file, $exclude);
if ($check !== false) {
$excluded = 'yes';
break;
}
}
}
Start by assigning $excluded = 'no';
. As soon as strripos
returns anything other than false
you assign $excluded = 'yes';
and break out of the foreach loop. This way you end up with either 'yes' or 'no'.