title: Cleaner way of using modulus for columns
body: <p>I currently have a list (&lt;ul&gt;) of people that I have divided up into two columns. But after finishing the code for it I keept wondering if there is a more effective or clean way to do the same thing. </p>
  
  <pre><code>echo "&lt;table class='area_list'&gt;&lt;tr&gt;";
  // Loop users within areas, divided up in 2 columns
  $count = count($areaArray);
  for($i=0 ; $i&lt;$count ; $i++) {
    $uid = $areaArray[$i];
    // get the modulus value + ceil for uneven numbers
    $rowCalc = ($i+1) % ceil($count/2);
  
    if ($rowCalc == 1) echo "&lt;td&gt;&lt;ul&gt;";
  
    // OUTPUT the actual list item
    echo "&lt;li&gt;{$users[$uid]-&gt;profile_lastname}&lt;/li&gt;";
  
    if ($rowCalc == 0 &amp;&amp; $i!=0) echo "&lt;/ul&gt;&lt;/td&gt;";
  }
  echo "&lt;/tr&gt;&lt;/table&gt;";
  </code></pre>