This is a very strange situation, we have a list of bad words and all worked perfect until a customer by the name "Claudia" tried to submit the form:
$blocked = ['audi','opel','vw','mercedes','porsche'];
$input = 'Claudia';
$matched = preg_match_all("/(".implode('|', $blocked).")/i", $input);
if($matched > 0) {
echo "Your word: {$input} is blocked";
} else {
echo "Your word: {$input} is OK";
}
How to make this bad words checker to work also if you try to submit with input "Claudia"?
But NOT with:
"my audi"
"-audi-"
"**audi**"
... Or any other variations with audi?