PHP include Keyword

❮ PHP Keywords

Example

Use include to add a footer to a page:

<!DOCTYPE html>
<html>
<body>

<h1>Welcome to my home page!</h1>
<p>Some text.</p>
<p>Some more text.</p>
<?php include 'footer.php';?>

</body>
</html>
Try it Yourself »

Definition and Usage

The include keyword is used to embed PHP code from another file. If the file is not found, a warning is shown and the program continues to run.


Related Pages

The include_once keyword

The require keyword

The require_once keyword

Read more about including files in our PHP Include Files Tutorial.


❮ PHP Keywords
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.