Twelve Days of Christmas by CameronM

<?php $y="\n";$q=",$y";$t="$y$y";$a="On the ";$b=" day of Christmas,".$y."my true love sent to me".$y;$d="Twelve drummers drumming";$e="Eleven pipers piping";$f="Ten lords a-leaping";$g="Nine ladies dancing";$h="Eight maids a-milking";$i="Seven swans a-swimming";$j="Six geese a-laying";$k="Five golden rings";$l="Four calling birds";$m="Three French hens";$n="Two turtle doves";$o="partridge in a pear tree";$s=array(1=>"first",2=>"second",3=>"third",4=>"fourth",5=>"fifth",6=>"sixth",7=>"seventh",8=>"eighth",9=>"ninth",10=>"tenth",11=>"eleventh",12=>"twelfth");for($r=1;$r<13;$r++){$x=""; switch($r){case 12:$x=$d.$q; case 11:$x=$x.$e.$q; case 10:$x=$x.$f.$q; case 9:$x=$x.$g.$q; case 8:$x=$x.$h.$q; case 7:$x=$x.$i.$q; case 6:$x=$x.$j.$q; case 5:$x=$x.$k.$q; case 4:$x=$x.$l.$q; case 3:$x=$x.$m.$q; case 2:$x=$x.$n.$q."And a ";break; case 1:$x="A ";}echo $a.$s[$r].$b.$x.$o;if($r<12) echo ".$t";else echo "!";}?>

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page