“include”myfile.php的作用是什么?

“include”myfile.php的作用是什么?,php,syntax,Php,Syntax,以下php代码行中符号的含义是什么: include myfile.php;注释掉它-这是一个Perl风格的注释,具有与C风格注释相同的功能。查看php中注释的不同方式。表示注释掉了该行。是一个单行注释。它表示没有使用代码行。哈希只是一个单行注释字符ter.它将该行标记为注释,因此实际上不执行include指令 在下面的代码中,仅包含myfile1.php: <?php include "myfile1.php"; // include "myfile2.php"; # include "

以下php代码行中符号的含义是什么:


include myfile.php;

注释掉它-这是一个Perl风格的注释,具有与C风格注释相同的功能。

查看php中注释的不同方式。

表示注释掉了该行。

是一个单行注释。它表示没有使用代码行。

哈希只是一个单行注释字符ter.

它将该行标记为注释,因此实际上不执行include指令

在下面的代码中,仅包含myfile1.php:

<?php
include "myfile1.php";
// include "myfile2.php";
# include "myfile3.php";
?>

它作为单行注释工作,与//完全相同

要包含文件,请使用

include("myfile.php"); # or
require("myfile.php"); # dies if fails to include