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 the difference between php traits vs interfaces?
Explain mail function in PHP with syntax?
What is php oops concepts?
Difference between mysql_connect and mysql_pconnect?
Explain how can we execute a php script using command line?
How to convert numbers to strings in php?
How can we get the error when there is a problem to upload a file?
Explain what is the difference between session and cookie?
What sized websites have you worked on in the past?
Which operator is used to combine string values in php?
What are the characteristics of php?
How can we know the total number of elements of Array?
Can a trait extend a class php?
What is overloading and overriding in php?
What is $_ files in php?