What are the differences between include() and include_once
() functions?
Answers were Sorted based on User's Feedback
Answer / anjali ashok arote
include()function is more time consuming because of redeclaration is more in include() file ...
where as include_once()function only declare one time...
in include()function refreshment of file is needed many time
but in include_once()function refreshment of page is only one time
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / nishit
file1.php:
function check()
{
echo 'hello nishit';
}
file2.php
include('file1.php');
check();
file3.php
include('file1.php');[this is worn we should use here
include once.]
include('file2.php');
check();
while execute file3.php see what the error:
| Is This Answer Correct ? | 4 Yes | 5 No |
What is sorting php?
What is sticky form in php?
What are getters and setters php?
What are the ways we can destroy a session variable ?
What is php dependency injection?
How can we submit from without a submit button?
What is local variable in php?
What is the meaning of symbol '$' in jquery?
What are constructor and destructor in PHP?
What are the new features in php 7?
How to call javascript function in php on button click?
Why shouldn't I use mysql_* functions in php?