I keep getting the message:
Notice: Array to string conversion in /home/public_html/user.php on line 123
And were I the $bword[] is it just comes up with array, or if i use print_r() it comes up with:
Array ( [0] => ass [1] => * )
Also if the bad word is word, I get bad instead of word.
Code: Select all
$username_bad_check = $username;
$username_bad_check = strtolower($username_bad_check);
$badwords = array();
$badwords[] = array('bad', ' * ');
$badwords[] = array('word', ' * ');
array_change_key_case($badwords,CASE_LOWER);
/*$username_bad_check = implode("\r\n", $username_bad_check); */
foreach ($badwords as $bword)
{
if (str_replace($username_bad_check, $badwords, $bword)){
echo "OH NO YOU DID'T. We have found a bad word in your username! You may have put something bad in by mistake, but remember if you use bad words* on our site.<br><b>Your username can not contain the word: </b>" . $bword[] . "<br><br><br><Br>*The term \"Bad Word\" refeers to a curse words, an explicit words, or any other inappropriate word, or word we find to be inappropriate." ;
exit;
}
}