title: Dynamically adding divs in php list
body: <p>I have a list that is created by the code below:</p>
  
  <pre><code>$facilities_bid = get_the_term_list( 
                    $post-&gt;ID, 
                    'room_facilities', 
                    '&lt;ul class="fac-styles"&gt;
                      &lt;li&gt;
                      &lt;i class="fa fa-circle-o" aria-hidden="true"&gt;', '&lt;/i&gt;
                      &lt;/li&gt;
                      &lt;li&gt;
                      &lt;i class="fa fa-circle-o" aria-hidden="true"&gt;', '&lt;/i&gt;
                      &lt;/li&gt;
                     &lt;/ul&gt;' );
  echo strip_tags($facilities_bid, '&lt;ul&gt;&lt;li&gt;&lt;i&gt;');
  </code></pre>
  
  <p>The HTML output is:</p>
  
  <pre><code> &lt;ul class="fac-styles"&gt;
    &lt;li&gt;&lt;i class="fa fa-circle-o" aria-hidden="true"&gt;Air Conditioning&lt;/i&gt;&lt;/li&gt;
    &lt;li&gt;&lt;i class="fa fa-circle-o" aria-hidden="true"&gt;Coffee machine&lt;/i&gt;&lt;/li&gt;
    &lt;li&gt;&lt;i class="fa fa-circle-o" aria-hidden="true"&gt;Flat-screen TV&lt;/i&gt;&lt;/li&gt;
    &lt;li&gt;&lt;i class="fa fa-circle-o" aria-hidden="true"&gt;Free WiFi&lt;/i&gt;&lt;/li&gt;
    &lt;li&gt;&lt;i class="fa fa-circle-o" aria-hidden="true"&gt;Hairdryer&lt;/i&gt;&lt;/li
    &lt;li&gt;&lt;i class="fa fa-circle-o" aria-hidden="true"&gt;Telephone&lt;/i&gt;&lt;/li&gt;
    &lt;/ul&gt;
  </code></pre>
  
  <p>I want the list to be such that, the php automatically created nested divs after after every three items to be:</p>
  
  <pre><code>  &lt;div class="one"&gt;
    &lt;ul class="fac-styles"&gt;
    &lt;li&gt;&lt;i class="fa fa-circle-o" aria-hidden="true"&gt;Air Conditioning&lt;/i&gt;&lt;/li&gt;
    &lt;li&gt;&lt;i class="fa fa-circle-o" aria-hidden="true"&gt;Coffee machine&lt;/i&gt;&lt;/li&gt;
    &lt;li&gt;&lt;i class="fa fa-circle-o" aria-hidden="true"&gt;Flat-screen TV&lt;/i&gt;&lt;/li&gt;
    &lt;/ul&gt;
    &lt;/div&gt;
    &lt;div class="one"&gt;
    &lt;ul class="fac-styles"&gt;
    &lt;li&gt;&lt;i class="fa fa-circle-o" aria-hidden="true"&gt;Free WiFi&lt;/i&gt;&lt;/li&gt;
    &lt;li&gt;&lt;i class="fa fa-circle-o" aria-hidden="true"&gt;Hairdryer&lt;/i&gt;&lt;/li
    &lt;li&gt;&lt;i class="fa fa-circle-o" aria-hidden="true"&gt;Telephone&lt;/i&gt;&lt;/li&gt;
    &lt;/ul&gt;
    &lt;/div&gt;
  </code></pre>