Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. $names = array();
  2. for ($i = 0; $i < 100; $i++) {
  3. $names[] = $i;
  4. }
  5.  
  6. $parts = count($names) / 20;
  7.  
  8. $j = 0;
  9.  
  10. for ($i = 0; $i < $parts; $i++) {
  11. echo "Part" . $i."<br>";
  12. $newarray = array_slice($names, $j, 20);
  13. for ($i = 0; $i < count($newarray); $i++) {
  14. echo $i;
  15. }
  16. $j = $j + 20;
  17. }
  18.  
  19. $j = 0;
  20.  
  21. for ($i = 0; $i < $parts; $i++) {
  22. echo "Part" . $i."<br>";
  23. $newarray = array_slice($names, $j, 20);
  24. for ($i1 = 0; $i1 < count($newarray); $i1++) {
  25. echo $i1;
  26. }
  27. $j = $j + 20;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement