What's the meaning of the # symbol in the following line of php code:
#include "myfile.php";
What's the meaning of the # symbol in the following line of php code:
#include "myfile.php";
Comments it out - this is a "Perl-style comment", with the same function as the "C-style comment" //
. See the documentation for different ways of commenting in PHP.
#
is a single line comment. It means that line of code is not being used.
It marks the line as a comment, so the include directive isn't actually executed.
In the code below only myfile1.php will be included:
<?php
include "myfile1.php";
// include "myfile2.php";
# include "myfile3.php";
?>
It works as a single line comment, exactly as // does.
In order to include a file, use
include("myfile.php"); # or
require("myfile.php"); # dies if fails to include