= 0; $i--) { /* SET DEFAULTS */ $bottleCount = $i; $bottle = 'bottles'; $action = 'Take one down and pass it around'; $remainingBottles = $i-1; /* HANDLE EXCEPTIONS */ if($i == 0) { $bottleCount = 'no more'; $action = 'Go to the store and buy some more'; $remainingBottles = $bottleNumber; } if($i == 1) { $bottle = 'bottle'; $action = 'Take it down and pass it around'; $remainingBottles = 'no more'; } /* BUILD LYRICS */ $lyrics .= ucfirst($bottleCount).' '.$bottle.' of '.$fluid.' on the '.$location.', '.$bottleCount.' '.$bottle.' of '.$fluid.'.
'."\n"; $lyrics .= $action.', '.$remainingBottles.' bottles of '.$fluid.' on the '.$location.'.

'."\n\n"; } /* OUTPUT TO PAGE */ echo $lyrics; ?>