PHP AdvancedLesson 31Free preview
PHP Include
This lesson is part of PHP · All levels
Summary
The include feature allows you to insert the contents of other files into the script, so the same part does not need to be rewritten. It's useful for header, footer, or shared configuration. This lesson also distinguishes include from require as well as the advantages of include_once and require_once.
Key points
- Include inserting other file contents while the script is running
- Require the same function, but stop the script when the file is not found
- Include_once/require_once prevents the same file from being loaded more than once
- Header/footer separation makes it easy to maintain multiple pages
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.