本文側でincludeを使ってヘッダーとフッターのPHPファイルを呼び出している。
header.php
<!DOCTYPE HTML>
<html lang="jp">
<head>
<title></title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta property="og:title" content="SNS用のページタイトル">
</head>
<body>
index.php
<?php include('header.php'); ?>
<h1></h1>
<?php include('footer.php'); ?>
footer.php
</body>
</html>