Skip to content

Instantly share code, notes, and snippets.

@cwhite92
Created November 19, 2015 12:13
Show Gist options
  • Save cwhite92/d0f3a05e0024ce8dfc6d to your computer and use it in GitHub Desktop.
Save cwhite92/d0f3a05e0024ce8dfc6d to your computer and use it in GitHub Desktop.
PHP 99 bottles golf
<?php $b=99;$d=" bottles of beer";$c=$d." on the wall";$f="file";do{echo $b.$c.", ".$b.$d.".\n";if(--$b==0){echo $f('http://is.gd/sKW90b')[0];$b=99;}else echo $f('http://is.gd/2m5PYo')[0];echo ", ".$b.$c.".\n\n";}while($b<99);
<?php
$b=99;
$d=" bottles of beer";
$c=$d." on the wall";
$f="file";
do{
echo $b.$c.", ".$b.$d.".\n";
if(--$b==0){
echo $f('http://is.gd/sKW90b')[0];$b=99;
}else
echo $f('http://is.gd/2m5PYo')[0];
echo ", ".$b.$c.".\n\n";
}while($b<99);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment