Advertisement
cd62131

foreach

Feb 23rd, 2014
481
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.23 KB | None | 0 0
  1. <?php
  2. $arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
  3. $c = 0;
  4. foreach ($arr as &$v) {
  5.   echo <<<EOS
  6. <div class="content01">
  7. <p>hogehoge{$v}</p>
  8. </div>
  9.  
  10. EOS;
  11.   $c++;
  12.   if ($c % 5 == 0) echo '<div id="content_area">', PHP_EOL;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement