include
Using this approach, we have the ability to include the same header.php file into multiple pages.
<html>
<body>
<?php include 'header.php'; ?>
<p>This is a paragraph</p>
</body>
</html>
<body>
<?php include 'header.php'; ?>
<p>This is a paragraph</p>
</body>
</html>
Result:
Files are included based on the file path.
You can use an absolute or a relative path to specify which file should be included.
You can use an absolute or a relative path to specify which file should be included.
No comments:
Post a Comment