This Old Man Param
Demonstrates the use of function parameters
print verse(1);
print chorus();
print verse(2);
print chorus();
print verse(3);
print chorus();
print verse(4);
print chorus();
function verse($stanza) {
switch ($stanza){
case 1:
$place = "thumb";
break;
case 2:
$place = "shoe";
break;
case 3:
$place = "knee";
break;
case 4:
$place = "door";
break;
default:
$place = "I don't know where";
} // end switch
$output = <<This old man, he played $stanza
He played knick-knack on my $place
HERE;
return $output;
} // end verse
function chorus() {
$output = <<... with a knick-knack
paddy-whack
give a dog a bone
this old man came rolling home
HERE;
return $output;
} // end chorus
?>