Voting

Category

real language

Bookmarking

Del.icio.us Digg Diigo DZone Earthlink Google Kick.ie
Windows Live LookLater Ma.gnolia Reddit Rojo StumbleUpon Technorati

Language PHP4

(standard version)

Date:04/20/05
Author:Samuel Dennler
URL:n/a
Comments:0
Info:n/a
Score: (2.97 in 30 votes)
By Samuel Dennler for PHP4

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<title>99 Bottle of beer</title>
<meta name="author" content="Samuel Dennler">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>

<h1>99 Bottle of beer</h1>

<?php
  for($i=99; $i>=1; $i--){
  $s = $i > 1?"s":"";
  echo "<p>$i Bottle$s of beer on the wall, $i bottle$s of beer.<br>";
  echo "Take one down and pass it around,<br>";
  echo ($i-1)." bottle$s of beer on the wall.</p>\n";
}
?>

<p>No more bottles of beer on the wall.<br>
No more bottles of beer...<br>
<a href="<?php echo $PHP_SELF ?>">Go to the store</a> and buy some more...<br>
99 bottles of beer.</p>

</body>
</html>

Download Source | Write Comment

Alternative Versions

VersionAuthorDateCommentsRate
graphic version using HTML tablescaminoix08/07/0519

Comments

Download Source | Write Comment

Add Comment

Please provide a value for the fields Name, Comment and Security Code.
This is a gravatar-friendly website.
E-mail addresses will never be shown.
Enter your e-mail address to use your gravatar.

Please don't post large portions of code here! Use the form to submit new examples or updates instead!

Name:

eMail:

URL:

Security Code:
  
Comment: