Macro photograph of the interior jewelled workings of a pocketwatch

Even if you only pepper your site with snippets of PHP for its sheer utility, you still need to know the basics, which includes variables, arrays, the date() function, and includes.

Goals: Create an include() that adds the current date to a web page using concatenation; make and use a simple variable, array, and a basic function.

Total time for practice: 4 hours

Prerequisites: Introduction to PHP

Core Material

  1. echo
  2. includes
  3. date
  4. Variables
  5. Arrays
  6. Concatenation
  7. functions

Suggested Reading

There are several books I would suggest to learn PHP: I would highly recommend PHP for the Web: Visual QuickStart Guide (4th Edition), by Larry Ullman, published by Peachpit Press. You might also want to check out and the previously mentioned Codecademy resources.

When You’re Done

If you’ve finished this reading list and have a basic site in HTML and CSS, now is an excellent opportunity to rework it with include() and other PHP features.

Next, we’ll look at one of the most common uses of PHP: server-side form validation and data processing.

Photograph by Carles Just, used with permission

Enjoy this piece? I invite you to follow me at to learn more.