Advertisement
Guest User

Untitled

a guest
Aug 14th, 2012
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.29 KB | None | 0 0
  1. <?php
  2. $rows = range(0, 20);
  3.  
  4. $lastKey = end(array_keys($rows));
  5.  
  6. foreach ($rows as $k => $row) {
  7.     if (!($k % 3)) {
  8.         echo '<div class="row-fluid">'.PHP_EOL;
  9.     }
  10.     echo '<div class="span4">span4</div>'.PHP_EOL;
  11.    
  12.     if (!(($k + 1) % 3) || $k == $lastKey) {
  13.         echo '</div>'.PHP_EOL;
  14.     }
  15. }
  16. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement