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
Explain what is the static variable in function useful for?
How to do single and multi line comment in php?
What is csrf validation?
How to Pass JSON Data in a URL using CURL in PHP?
Is it worth learning php in 2019?
What are the 5 types of data?
How can we submit form without a submit button?
What is the purpose of pear in php?
what is the scope of php in the future if any other language is developed then may be php is loss ???
Does php have a future?
Tell me what are sql injections, how do you prevent them and what are the best practices?
What is the use of header in php?
What is mysqli_real_escape_string?
What is the default session out time?
How to send email using php script?