Guest User

http://www.reddit.com/r/dailyprogrammer/comments/pserp/21620

a guest
Feb 16th, 2012
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.60 KB | None | 0 0
  1. <?php
  2.  
  3. for ($i = 99; $i > 0; $i--) {
  4.     switch ($i) {
  5.         case 1:
  6.             echo "$i bottle of beer on the wall, $i bottle of beer, take one down, pass it around, No more bottles of beer on the wall.";
  7.             break;
  8.         case 2:
  9.             echo "$i bottles of beer on the wall, $i bottles of beer, take one down, pass it around, 1 more bottle of beer on the wall.";
  10.             break;
  11.         default:
  12.             echo "$i bottles of beer on the wall, $i bottles of beer, take one down, pass it around, " . ($i - 1) . " bottles of beer on the wall.";
  13.             break;
  14.     }
  15. }
  16. ?>
Add Comment
Please, Sign In to add comment