I tried suggested solutions from other regex questions with preg_match but to no avail.
$match = '/^(.|a|an|and|the|this|at|in|or|of|is|for|to|its|as|by)\$/';
$filteredArray = array_filter($wordArray, function($x){
return !preg_match($match,$x);
});
It works when I include the string literal but I'd like to use a variable so I can add more words. This version works:
$filteredArray = array_filter($wordArray, function($x){
return !preg_match("/^(.|a|an|and|the|this|at|in|or|of|is|for|to|its|as|by)$/",$x);
});
I appreciate any help!