title: Bootstrap collapse within a for loop php
body: <p>I would like an bootstrap accordion in PHP for loop. But it doesn't collapse. I'm not sure what I'm doing wrong.  </p>
  
  <p>Here my code.</p>
  
  <pre><code>&lt;?php
  $row_count = 1;
  for ($x = 0; $x &lt; 5; $x++) {
  
    echo $row_count ;
    ?&gt;
  
  
    &lt;div class="panel-group" id="accordion"&gt;
      &lt;div class="panel panel-default"&gt;
        &lt;div class="panel-heading"&gt;
          &lt;h4 class="panel-title"&gt;
            &lt;a data-toggle="collapse" data-parent="#accordion" href="#collapse1&lt;?php echo $row_count; ?&gt;"&gt;Collapsible Group 1&lt;/a&gt;
          &lt;/h4&gt;
        &lt;/div&gt;
        &lt;div id="collapse1&lt;?php echo $row_count ?&gt;" class="panel-collapse collapse "&gt;
          &lt;div class="panel-body"&gt;Lorem.&lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt; 
  
  
    &lt;?php
  $row_count  ++;
  }
  
  ?&gt;
  </code></pre>