difference between include and require
Posted: Sat Jun 05, 2004 5:50 am
is there any difference between include and require?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
from the php manualThe two constructs are identical in every way except how they handle failure. include() produces a Warning while require() results in a Fatal Error. In other words, use require() if you want a missing file to halt processing of the page. include() does not behave this way, the script will continue regardless. Be sure to have an appropriate include_path setting as well.
When a file is included, the code it contains inherits the variable scope of the line on which the include occurs. Any variables available at that line in the calling file will be available within the called file, from that point forward.