What are the differences between include() and include_once
() functions?

Answers were Sorted based on User's Feedback



What are the differences between include() and include_once () functions?..

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

What are the differences between include() and include_once () functions?..

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

Post New Answer

More PHP Interview Questions

What is the importance of "method" attribute in a html form?

0 Answers  


How to download file in php?

0 Answers  


Tell me how can we get the error when there is a problem to upload a file?

0 Answers  


What are the php variables?

0 Answers  


Write a program to find the factorial of a number in php?

0 Answers  


how to work lamp server

0 Answers  


To find out the current year is leap year or not which date() function we've to use.Give the syntax also

5 Answers  


Write a program in php to check whether a number is prime or not?

0 Answers  


Is md5() is breakable if yes than how?

1 Answers  


How can we change the maximum size of the files to be uploaded?

0 Answers  


How be the result set of mysql handled in php?

0 Answers  


What is constructors and destructors?

0 Answers  


Categories