Web Design/Dynamic Websites/Simple Functions in PHP

Note: Work in progress PHP.net has a reference on PHP functions, but it's a little complicated for your average beginner.

Example PHP file with function
Try testing the following PHP file: 

Can you explain why it does what it does?

Example 2: a function with an argument
A small modification:  Can you explain what's happening this time?

Example 3: Something more useful
So far we've done simple PHP templating using include files. But we can replace this with functions to, and give ourselves some extra power while we're at it! Try the following:      Home page of my site

My website 

Again, test out this page and then see if you can explain what it's doing!

Here's the challenge:
 * 1) See if you can modify your printHeader function so that you can say: printHeader("Page 2"); - and the text "Page 2" will be displayed in the title tags (look back to a previous example!)
 * 2) Try creating and using your own printFooter function.

Of course, we'd remove these functions into an include-file so that we can reuse them on other pages!