What's the diff. between include() and Include_once().
Answer Posted / murali
include_once() will not include a file that has already been
included. include() will include a file every time.
include_once() is useful if you have php scripts which
include scripts which include scripts. If 2 of the scripts
include the same file then you might get variables and other
things being overwritten. Using include_once() ensures you
get the functionality that the scripts need but without any
side effects.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
How to redirect https to http url and vice versa in .htaccess?
Why do you need php?
Write a program using while loop?
What are php data types?
How to assigning a new character in a string using php?
What is the use of magic function in php?
Which is the best web server?
Explain what is the use of "echo" in php?
How can you compare objects in php?
Is php class name case sensitive?
What is PHP's configuration file called?
Is php a low level language?
How is csrf token generated?
What are the new features available in php 7?
With a heredoc syntax, do I get variable substitution inside the heredoc contents?