PHP include

<html>
<body>

<h1>欢迎访问我们的首页!</h1>
<p>一段文本。</p>
<p>一段文本。</p>
<div class="menu">
<?php include 'menu.php';

//include '../2-html/2-html.php'; // ./表示当前目录
// require '../2-html/2-html.php';// 表示调用
//include './menu.php';
?>
</div>

</body>
</html>

menu.php

<?php
echo '<a href="/index.asp">首页</a> -<a href="/html/index.asp">HTML 教程</a> -
<a href="/css/index.asp">CSS 教程</a> -
<a href="/js/index.asp">JavaScript 教程</a> -
<a href="/php/index.asp">PHP 教程</a>'; //条件是在该服务器下有这些网页
?>

原文地址:https://www.cnblogs.com/jiangger/p/6439788.html