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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

How to open a file for reading?

759


Explain do you use composer? If yes, what benefits have you found in it?

738


How to enable cURL in PHP?

878


What are the features and advantages of object-oriented programming in php?

682


What is the difference server side and browser side validation?

694


Do csrf tokens expire?

689


What are the methods of array in java?

703


Explain Type juggling?

757


Which function parses an English textual date or time into Unix timestamp in PHP.

774


What is null value in php?

749


Do you know what does $globals means?

810


How can we execute a php script using command line?

724


Is salary fixed or variable cost?

717


Tell me what is the difference between the functions strstr() and stristr()?

751


Which function is used in php to delete a file?

756