foreach


SUBMITTED BY: Guest

DATE: Nov. 21, 2013, 3:08 a.m.

FORMAT: Text only

SIZE: 1.2 kB

HITS: 691

  1. foreach($this->rpanelinks as $name => $url) {
  2. echo '<a href="' . BASE_URL . $url . '">' . $name . '</a>';
  3. }
  4. $i = 1;
  5. foreach($this->rpanelinks as $name => $url) {
  6. if($i == 4)
  7. echo '<br>';
  8. echo '<a href="' . BASE_URL . $url . '">' . $name . '</a>';
  9. ++$i;
  10. }
  11. $i = 1;
  12. foreach($this->rpanelinks as $name => $url) {
  13. if($i % 4 == 0)
  14. echo '<br>';
  15. echo '<a href="' . BASE_URL . $url . '">' . $name . '</a>';
  16. ++$i;
  17. }
  18. $counter = 0;
  19. foreach($this->rpanelinks as $name => $url) {
  20. $counter ++;
  21. echo '<a href="' . BASE_URL . $url . '">' . $name . '</a>';
  22. if ($counter %4 == 0) echo '<br />';
  23. }
  24. $i = 0;
  25. foreach($this->rpanelinks as $name => $url) {
  26. ++$i;
  27. if($i >= 4){
  28. echo '<br/>';
  29. $i=0;
  30. }
  31. echo '<a href="' . BASE_URL . $url . '">' . $name . '</a>';
  32. }
  33. $counter = 0;
  34. foreach($this->rpanelinks as $name => $url) {
  35. echo '<a href="' . BASE_URL . $url . '">' . $name . '</a>';
  36. if(++$counter % 4 == 0) {
  37. echo '<br />';
  38. }
  39. }

comments powered by Disqus