Code used in the O'Reilly Intermediate PHP Video