PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Can someone help me with this. I want the following PHP code to look at the variable $username_bad_check which is equal to the $username (in this case 'ass12345'). If it finds any of the words in the $badwords array. Then it displays the message.
<?php
$username = 'ass12345';
$username_bad_check = $username;
$username_bad_check = strtolower($username_bad_check);
$username_bad_check = " ".$username_bad_check." ";
// Array, Badword, Goodword
// Goodword is not used.
$badwords = array();
$badwords[] = array('ass', ' * ');
if($username_bad_check == $badwords){
echo "OH NO YOU DIDN\'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><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.";
}
?>
Last edited by tecktalkcm0391 on Tue Jun 06, 2006 10:02 pm, edited 1 time in total.