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
Can we extend two classes in php?
What type of headers have to be added in the mail function to attach a file?
What does $_cookie mean?
Why php 7 is faster?
What is difference between static and constant in php?
What does the php error 'parse error in php - unexpected t_variable at line x' means?
What is artisan in php?
What is php? Why it is used?
What the limitation of header() function in php?
Which are the best start and end tags to use?
What is echo in html?
Is null function in php?
What is putenv?
Can I learn php without knowing c?
How to set cookies?