Guest User

Untitled

a guest
Jun 19th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. <?php
  2.  
  3. $picList = array();
  4. for ($i = 0; $i < 200; $i++)
  5. $picList[] = "pic$i.jpg";
  6.  
  7. $c = 1;
  8. $div1 = 30;
  9. $div2 = 6;
  10.  
  11. $l = array();
  12. $tmpl1 = array();
  13. $tmpl2 = array();
  14.  
  15. foreach ( $picList as $p ) {
  16. $tmpl2[] = $p;
  17. if ( !( $c % $div2 ) ) {
  18. $tmpl1[] = $tmpl2;
  19. $tmpl2 = array();
  20. }
  21. if ( !( $c % $div1 ) ) {
  22. $l[] = $tmpl1;
  23. $tmpl1 = array();
  24. }
  25. $c++;
  26. }
  27.  
  28. echo "<ul>";
  29. foreach ( $l as $tbl ) {
  30. echo "<hr />";
  31. echo "<li>";
  32. echo "<table border=\"1\">";
  33. foreach( $tbl as $tr ) {
  34. echo "<tr>";
  35. foreach( $tr as $td ) {
  36. echo "<td>$td</td>";
  37. }
  38. echo "</tr>";
  39. }
  40. echo "</table>";
  41. echo "</li>";
  42. }
  43. echo "</ul>";
Add Comment
Please, Sign In to add comment