Skip to content

Instantly share code, notes, and snippets.

@luizmarcus
Created December 4, 2022 23:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luizmarcus/c53be2b4c707a2a2ca4396bbdea452a1 to your computer and use it in GitHub Desktop.
Save luizmarcus/c53be2b4c707a2a2ca4396bbdea452a1 to your computer and use it in GitHub Desktop.
<?php
function checkBlackList($txt) {
$response = [];
$count=0;
foreach (DEFAULT_BLACKLIST as $word) {
if (stripos($txt, $word) !== false) {
$count++;
array_push($response, $word);
}
}
if(!empty($response)){
return "Encontrei ".$count. " palavra(s) dentre as que não devem ser usadas nesse grupo: ".implode(", ",$response);
}else{
return "";
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment