Hi friends,
I was using include function in my php script so while using include() at some point of time i found myself in a dilemma so please help me out, What happens if no file path is given in include() function?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satyapriya NayakPosted Dec 24, 2011, 2:26 AM
include() produces a Warning, the script will continue to run.
Files are included based on the file path given or, if none is given, the include_path specified. If the file isn't found in the include_path, include() will finally check in the calling script's own directory and the current working directory before failing. The include() construct will emit a warning if it cannot find a file; this is different behavior from require(), which will emit a fatal error.
Difference between include() and require()
require() produces a FATAL ERROR if the file you want to include is not found, while include() only produces a WARNING.
Thanks