A
Anonymous
Guest
Suppose I have a variable $name and I want to assign a phrase to $answer if $name contains "word1", "word2", "word3", "word4" etc. Is there a simple way to construct the IF statement without (IF xxx = "word1") OR (IF xxx = "word2") OR (IF xxx = "word3") ? It seems very inelegant to do it that way!
IF (strpos(strtolower($name), "word1")){
$answer = "That's not a real word. ";
}
Thanks in anticipation.
IF (strpos(strtolower($name), "word1")){
$answer = "That's not a real word. ";
}
Thanks in anticipation.