title: Break and Create new <ul> after 10 values from foreach loop php
body: <p>Im looking to create a 2 or more ul class with li content from a foreach loop if the values count more than 5.</p>
  
  <pre><code>$data = array('Barcelona','Jujuy','Cordoba','Mendoza','Galicia','Madrid','Estonia','New York');
  
  echo '&lt;ul class="row1"&gt;';
  foreach($data as $value){
  
     echo '&lt;li&gt;' . $value . '&lt;/li&gt;';
  
  }
  echo '&lt;/ul&gt;'
  </code></pre>
  
  <p>the result will be: </p>
  
  <pre><code>&lt;ul class="row1"&gt;
    &lt;li&gt;Barcelona&lt;/li&gt;
    ...
    ...
  &lt;/ul&gt;
  </code></pre>
  
  <p>What i want is after 5 towns create a new ul class like </p>
  
  <pre><code>&lt;ul class="row1"&gt;
    &lt;li&gt;Barcelona&lt;/li&gt;
    ...
    ...
    ...
    ...
  &lt;/ul&gt;
  
  &lt;ul class="row2"&gt;
    &lt;li&gt;Madrid&lt;/li&gt;
    ...
    ...
    ...
    ...
  &lt;/ul&gt;
  </code></pre>
  
  <p>Is there a way to do this?</p>
  
  <p>Any help is appreciated. </p>