tags:

views:

92

answers:

6

What's the meaning of the # symbol in the following line of php code:

#include "myfile.php";

+9  A: 

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.

Piskvor
+3  A: 

means that the line is commented out.

SilentGhost
+1  A: 

# is a single line comment. It means that line of code is not being used.

Jon Weers
+1  A: 

The hash is simply a single-line comment character.

Martin Bean
+1  A: 

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";
?>
Anna Lear
A: 

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
Hamid Nazari