Hi, I'm trying to do something pretty simple but I'm stuck on what function I need to use. Basically, I have a script where you can type a message and submit it. But I don't want people to use bad words, so if they do, it displays an error message.
Example:
$string = "Fudge off!"
Let's say I don't like the word "fudge"
if ( stringcontains('fudge', $string) {
echo "No cussing!"
} else {
Post the string
}
Does that make sense? I'm basically trying to find some kind of search that will search a string of text looking for the word "fudge" and if it finds it, return a TRUE value. Does such a function exist?