title: How to insert <ul> in foreach loop every 10 records
body: <pre><code>&lt;?php foreach($products as $product) : ?&gt;
  
  &lt;li&gt;&lt;a href="&lt;?php echo base_url(); ?&gt;main/products/&lt;?php echo $product-&gt;id; ?&gt;"&gt;
  &lt;?php echo $product-&gt;name; ?&gt; &lt;/a&gt;&lt;/li&gt;
  
  &lt;?php endforeach; ?&gt;
  </code></pre>
  
  <p>So the code above get's all records in a <code>DB</code> and generates links. 100 Records in the table - I want to split the design into 5 col. So I will do that in <code>CSS</code> but I need to be able to enclose </p>
  
  <pre><code>&lt;ul&gt; on every 20 records&lt;/ul&gt;
  </code></pre>
  
  <p>How can i <code>count</code> the loop and do this?</p>