PHP: The difference between “include†and “requireâ€
I want to explain what the difference is between include and require in PHP because next time I won’t need to explain it in MSN again, can just show my blog.
Include and require does the same thing, which is it includes certain files. But why not just use include, why sometimes use require as well?
Include; When you are trying to include a file, if the file is missing, the entire page will still load and a warning message will display.
Require; When the include a file, if it is missing, the entire page will halt/stop loading, the page will freeze/blank/nothing/white colour with fatal error message.
When to use include or require? It depends on you. If you think the page needs to include very important files, use require, so when the file is missing, the page will halt, stop process.
Tags: PHP
Related posts:
- Error in suphp.c on line Am experimenting suphp on several servers for security reason. During...
- Yeha! PHP 5.2.0! PHP 5.2.0 released! Some on the features I like. The...
- FreeBSD CVSUP Assertion Error I have been having problems running port cvsup on one...
- Restore Missing Menu Bar or Menulet in Mac OSX Leopard One of my colleague menu bar / menulet is missing...
- Sheep In The Box Source Code Release Many of you who attended HITBSecConf06 might seen Sheep In...
- Cacti Spine Source Installation Error on FreeBSD Just noticed FreeBSD’s port still using old version of spine,...
- How to Install Cacti Plugin Architecture Cacti Plugin Architecture allow you to run useful monitoring plugins...