What is the difference between include and include_once ?
Which is one is good in terms of performance ?

Answers were Sorted based on User's Feedback



What is the difference between include and include_once ? Which is one is good in terms of perform..

Answer / abhishek dilliwal

u may include a single file several times by using
include() but by using include_once() its ensured tht the
specific file would be included only once no matter how
many times u wrote it ;)

-Abhishek Dilliwal
http://abhishek.x10hosting.com

Is This Answer Correct ?    13 Yes 2 No

What is the difference between include and include_once ? Which is one is good in terms of perform..

Answer / ankit

By Using include() function we can include a file any
number of times.But if you will face a Fatal error that is
a connect() or any function can not be redeclared then just
use include_once(), it will include that file only once,
then it doesn't matter how many times u include that
file. :)

Is This Answer Correct ?    5 Yes 3 No

Post New Answer

More PHP Interview Questions

In php how can you jump in to and out of "php mode"?

0 Answers  


Why are sessions used?

0 Answers  


Explain about Functions in PHP?

1 Answers  


How to get complete current page url in php?

0 Answers  


Tell me what is the importance of "action" attribute in a html form?

0 Answers  


How cookies are transported from servers to browsers?

0 Answers  


Do you know design patterns. List few?

0 Answers  


Explain include(), include_once, require() and require_once?

0 Answers  


What is the meaning of ‘escaping to php’?

0 Answers  


Php being an open source is there any support available to it?

0 Answers  


Tell me whether it is possible to share a single instance of a memcache between multiple php projects?

0 Answers  


What is alias in php?

0 Answers  


Categories