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
What is php dependency injection?
What is Mcrypt used for?
Tell me what are sql injections, how do you prevent them and what are the best practices?
What is the difference between php and core php?
What is T_PAAMAYIM_NEKUDOTAYIM?
When are you supposed to use endif to end the conditional statement?
How to use http headers inside php?
What is difference between python and php?
What is the use of $_server["php_self"] variable?
What is the difference between session_unregister() and session_unset()?
Can we override magic methods in php?
Will php die?
Why ide is recommended for use while programming with php?
What are objects in php?
How can I make a script that can be bilingual (supports english, german)?