© David Powers 2019
David PowersPHP 7 Solutionshttps://doi.org/10.1007/978-1-4842-4338-1_5

5. Lightening Your Workload with Includes

David Powers1 
London, UK

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. This means code can be incorporated into multiple pages—for example, common elements, such as a header, footer, or navigation menu. PHP merges the content into each page on the server, allowing you to update a menu or other common elements by editing and uploading a single file—a great timesaver.

As you work through this chapter, you’ll learn how PHP includes work, where PHP looks for include files, and how to prevent error messages when ...

Get PHP 7 Solutions: Dynamic Web Design Made Easy 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.