If I need a string to match this pattern: "word1,word2,word3", how would I check the string to make sure it fits that, in PHP?
I want to make sure the string fits any of these patterns:
word word1,word2 word1,word2,word3, word1,word2,word3,word4,etc.
Use regular expressions:
, asdf two,words four,or,more,words empty,word,
if you strictly want to match one or more whole words and not comma-separated phrases try: