PHP include Keyword

PHP include_once Keyword
PHP implements Keyword

In this article, you will learn how to embed code from another file in PHP. The include keyword in PHP 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.

examples of the include function

Example 1. In this example, we 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>
PHP include_once Keyword
PHP implements Keyword
en English
X
Scroll to Top