Tutorial :What does “#include ”myfile.php" do?



Question:

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

#include "myfile.php";


Solution:1

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.


Solution:2

means that the line is commented out.


Solution:3

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


Solution:4

The hash is simply a single-line comment character.


Solution:5

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";  ?>  


Solution:6

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  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »