Archive → May, 2010
PHP include vs. require
PHP programmers regularly use the functions (or more appropriately language construct) include(), include_once(), require() and require_once(), to insert useful codes written in other files, in the flow of execution. Although these constructs are used quite interchangeably, there are actually significant differences among them, specially when you are building well designed applications. Although these differences are very well defined in PHP manual, I've noticed many programmers don't really consider them while coding. I hope this tutorial will help them towards a better coding practice. Continue reading →