<?php
$frase = 'Caso o usuário fdp vsf escreva algum palavrão aqui, o mesmo não deve ser enviado';
$palavrao = '';
$palavroes = array ('pqp', 'fdp','vsf');
foreach ($palavroes as $value){
$pos = strpos($frase, $value);
if (!($pos === false))
$palavrao = $palavrao.$value.'|';
}
echo "Palavrões encontrados: ".$palavrao;
} else {
echo "Não tem palavrão";
}
?>
PD9waHAKJGZyYXNlID0gJ0Nhc28gbyB1c3XDoXJpbyBmZHAgdnNmIGVzY3JldmEgYWxndW0gcGFsYXZyw6NvIGFxdWksIG8gbWVzbW8gbsOjbyBkZXZlIHNlciBlbnZpYWRvJzsKJHBhbGF2cmFvID0gJyc7CiRwYWxhdnJvZXMgID0gYXJyYXkgKCdwcXAnLCAnZmRwJywndnNmJyk7CiAKZm9yZWFjaCAoJHBhbGF2cm9lcyBhcyAkdmFsdWUpewoJJHBvcyA9IHN0cnBvcygkZnJhc2UsICR2YWx1ZSk7CiAKCWlmICghKCRwb3MgPT09IGZhbHNlKSkKCQkkcGFsYXZyYW8gPSAkcGFsYXZyYW8uJHZhbHVlLid8JzsKIAp9CiAKaWYgKHN0cmxlbigkcGFsYXZyYW8pID4gMSkgewogICAgICAgZWNobyAiUGFsYXZyw7VlcyBlbmNvbnRyYWRvczogIi4kcGFsYXZyYW87CiB9IGVsc2UgewogICAgICAgZWNobyAiTsOjbyB0ZW0gcGFsYXZyw6NvIjsKIH0KPz4=