Chapter 4. Lightening Your Workload with Includes

Lightening Your Workload with Includes

The ability to include the contents of one file inside another is one of the most powerful features of PHP. It's also one of the easiest to implement.

Most pages in a website share common elements, such as a header, footer, and navigation menu. You can alter the look of those elements throughout the site by changing the style rules in an external style sheet. But CSS has only limited ability to change the content of page elements. If you want to add a new item to your menu, you need to edit the HTML in every page that displays it. Web authoring tools, such as Dreamweaver and Expression Web, have ...

Get PHP Solutions: Dynamic Web Design Made Easy, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.