Topic: function parameters

In the code below, I understand the $place variable and how it's working. What I can't understand is how I'M getting the output "he played 1, 2, etc... How is that function and the $stanza variable returning a single digit number? Thanks
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Param Old Man</title>


<h1>Param Old Man</h1>
<h3>Demonstrates use of function parameters</h3>

print verse(1);
print chorus();
print verse(2);
print chorus();
print verse(3);
print chorus();
print verse(4);
print chorus();

function verse($stanza)
        case 1:
            $place = "thumb";
        case 2:
            $place = "shoe";
        case 3:
            $place = "knee";
        case 4:
            $place = "door";
            $place = "I don't know where";
    } //end switch

    $output = <<<HERE
    This old man, he played $stanza<br>
    He played knick-knack on my $place<br><br>
    return $output;
} //end veruse

function chorus()
    $output = <<<HERE
    ...with a knick-knack<br>
    give a dog a bone<br>
    this old man came rolling home<br>
    return $output;
}// end chorus


Re: function parameters

I don't really understand your question smile

print verse(2); call verse(2), which returns

This old man, he played 2<br>
He played knick-knack on my shoe<br><br>

After this string has been returned to function print, this function will ouput that string to your stdout: command line or web browser.

With you can create unlimited free cron jobs every 5 minutes :)

Re: function parameters

Your question is: why you're getting a number after "This old man, he played"?

Well, because you have "This old man, he played $stanza" on your string and $stanza is the number you give the function.