title: How to put comma, if a variable exist without using if statement.
body: <p>I have like 10 columns in mysql table. </p>
  
  <pre><code>tag1, tag2, tag3, tag4, tag5, tag6, tag7, tag8, tag9, tag10
  </code></pre>
  
  <p>Now, If tag1 always have a value. But other tag do not always have a value</p>
  
  <p>If, tag2 have a value, then only tag 3 or higher tags will have a chance of having a value. so on...</p>
  
  <p>If <code>tag6</code> have a value, then <code>tag1,tag2,tag3,tag4,tag5</code> 100% have a value, but cannot say about <code>tag7,tag8,tag9,tag10</code></p>
  
  <p>Got it? If no, ask me in comment section. </p>
  
  <p>Now, I echo those results like this: </p>
  
  <pre><code>'.$result[$x]["tag1"].' '.$result[$x]["tag2"].' '.$result[$x]["tag3"].' '.$result[$x]["tag4"].''.$result[$x]["tag5"].''.$result[$x]["tag6"].''.$result[$x]["tag7"].''.$result[$x]["tag8"].''.$result[$x]["tag9"].''.$result[$x]["tag10"].'
  </code></pre>
  
  <p>Result will be something like this:</p>
  
  <pre><code>John Emma Josh Tripp Ravina Ron Chandler Joey
  </code></pre>
  
  <p>Now, I can put comma using If statements, but i need to use a lot of if statements, which i do not want. Like 9-10 If statements. </p>
  
  <p>Any other way than that? </p>