亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

PHP ?? ??

?? ?? ???? ? ? ???? ??? ? ????? ???? ???? ??, ??? ?? ?? ???? HTML ?? ? ???? ??? ?? ???? ?? ????. ??? ?? ???? ?? ??? ?? ??? ?? ?? ??? ?? ??? ?? ??? ? ????. ??? ?? ?? ??? ?? ???? ? ?? ?? ??? ?? ?? ??? ???? ???? ?? ? ????.

PHP?? ??? ???? ???? require, require_once, include, include-once? ? ?? ??? ????.

????????????????????????????????????????????????????????????????????????????????????????????? ???? ??? ?? ?????. ????? ?? ??? ?????. ??. ???? ??? ???? ??? ?? ???? ????. ????? ?? ??? ??? ???? ??? ?? ??? ???? ? ???.
Include_once ??? ?????. ?? ?? ?? ??? ??? ??? ??? ?? ??? ?????. ? ?? ???? ??

Require_once ???? ?? ?? ?? 1 ??? ??? ????? ???? ?? ???? ?? Once ??? ?????.
PHP include ? require ?

PHP??? ???? ???? ?? PHP ??? ?? ??? ??? ? ????.

include ? require ?? ?? ??? ??? ??? ??? ?? ??? ???? ? ?????.

include? require? ?? ?? ??? ???? ?????.

require? ???? ??(E_COMPILE_ERROR)? ??? ? ???? ??? ?????.

include? ??(E_WARNING)? ???? ??? ??? ??? ????? ?? ?????.

??? ??? ??? ??? ?? ???? ??? ????? ????? include? ?????. ??? ?? ?? ?????, CMS ?? ??? PHP ?????? ???????? ?? require? ???? ?? ??? ?? ? ??? ?????. ?? ??? ??? ??? ??? ?? ?????? ??? ???? ????? ? ??? ???.

??? ???? ?? ??? ?????. ?? ?? ? ???? ?? ?? ???, ??? ?? ?? ??? ?? ? ??? ?????. ?? ?? ??? ?????? ? ? ?? ?? ??? ?????? ???.

??

include 'filename';

??

require 'filename' ??> ?? ?

"header.php"?? ?? ?? ??? ????. ????? ? ?? ??? ????? include/require? ?????.

<html>
<head>
<meta charset="utf-8">
<title>php中文網(wǎng)(php.cn)</title>
</head>
<body>
<?php include 'header.php'; ?>
<h1>歡迎來(lái)到我的主頁(yè)!</h1>
<p>一些文本。</p>
</body>
</html>
?? 2

?? ????? ???? ?? ?? ??? ??? ?????.

"menu.php":

echo '<a href="/">????</a>

<a href= "/html">HTML ????</a>

??????????????????????????????????????????????????????????????????????????????? ?? ???? ? ?? ??? ???? ???. ???? ?? ??? ??? ????.

<html>
<head>
<meta charset="utf-8">
<title>php中文網(wǎng)(php.cn)</title>
</head>
<body>
<div class="leftmenu">
<?php include 'menu.php'; ?>
</div>
<h1>歡迎來(lái)到我的主頁(yè)!</h1>
<p>一些文本。</p>
</body>
</html>

? 3

??? ???? ?? ??("vars.php")? ??? ?????.
<?php
 $color='red';
 $car='BMW';
?>
??? ??? ??? ????. ??? ??? ????:

<html>
<head>
<meta charset="utf-8">
<title>php中文網(wǎng)(php.cn)</title>
</head>
<body>
<h1>歡迎來(lái)到我的主頁(yè)!</h1>
<?php
include 'vars.php';
echo "I have a $color $car";   // 輸出 I have a red BMW
?>
</body>
</html>

? 4

file.php ??? ?????:

<?php
 $word = "你好!";
?>

?? ?? test.php? ?? ?? ??? ?????(? ? ??? ??? ????? ??):

<?php
 echo "包含內(nèi)容為:".$word."<br />";
 include("file.php");
 echo "包含內(nèi)容為:".$word;
?>

test.php? ???? ??? ?? ?????.

??? ??? ????.

??? ??? ????. Hello!

include()? require()? ???

require() ?? ???? include? ?? ????. ?? ?? include()? ?????. ??? ? ???? ??? ??? ????. ?? ??? ?? include() ?? require()? ??? ? ????.

?? ???? ??? ????. ??? ??? ?? ?(?? ?? ??) require()? ???? ????? ?? ??? ?????, include()? ???? ???? ??? ???? ? ??? ?? ???? ??? ?? ?????. ???? ?? ?? ??? ??? ? ????? ?? ???? ?? ???? ?? require() ??? ???? ?? ???? require() ? ?? ??? ???? ???? ???? ??? ?????. ??? ????, include()? ???? ??? ?????. ??? ??? ??? ?? ???? ??? include()? ???? ?? ? ?????

require()? ?? ??? ??? ?? ?? ??? ?? ?? ??? ? ?? ????? include( )? ?? ?????. ??? ???

? ?

?? ???? ???. include ? require? ?? ? ? ??? ?????: include_once ? require_once

?? ???? ??? ????. ?? ???

? ?? ??? ???? ????.

???? ??
||
<html> <head> <meta charset="utf-8"> <title>php中文網(wǎng)(php.cn)</title> </head> <body> <?php include 'header.php'; ?> //引入已經(jīng)建好的header.php文件 <h1>歡迎來(lái)到我的主頁(yè)!</h1> <p>一些文本。</p> </body> </html>