wryan
-
Posts
3 -
Joined
-
Last visited
Never
Posts posted by wryan
-
-
I realized I should mention something. Depending on which word in the list is matched, I'd like to set a variable = to a different value (a string actually). Here's a mockup:
String = "I'm at home"
Word list:
-home
-work
-dentist
-prison
-jupiter
-lost
do any of the words in the list show up in the string? If yes, then set string $Status equal to appropriate value for matched word (see below)
home = "a"
work = "b"
dentist = "c"
prison = "d"
jupiter = "e"
lost = "f"
I hope that makes sense...
-
Hello,
I am EXTREMELY new to PHP, and coding in general. I have attempted to search for an answer to this already, but I'm not sure I'm using terminology that will lead me to an solution, as I haven't come up with much. I'm hoping that someone can provide some assistance, or at least point me in the right direction for some reading.
What I am trying to do it search a string for a match to any of 12 words. I'm wondering if there is a smarter way to do this than coding 12 different lines, each one looking for a specific word.
If you can point me in the right direction, then thank you very much =)
Search string for any match to a list of words?
in PHP Coding Help
Posted
Thanks a million, Anti-Moronic! I'll start playing with that and see where I get =)