title: Check to see if a string matches a pattern
body: <p>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?</p>
  
  <p>I want to make sure the string fits any of these patterns:</p>
  
  <pre><code>word
  word1,word2
  word1,word2,word3,
  word1,word2,word3,word4,etc.
  </code></pre>