Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. <?php
  2. $plural = 's';
  3. foreach (range(99, 1) as $i) {
  4. echo "$i bottle$plural of beer on the wall,n";
  5. echo "$i bottle$plural of beer!n";
  6. echo "Take one down, pass it around!n";
  7. if ($i - 1 == 1)
  8. $plural = '';
  9.  
  10. if ($i > 1)
  11. echo ($i - 1) . " bottle$plural of beer on the wall!nn";
  12. else
  13. echo "No more bottles of beer on the wall!n";
  14. }
  15. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement