Created
December 4, 2022 23:43
-
-
Save luizmarcus/c53be2b4c707a2a2ca4396bbdea452a1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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