Tag Archives: include

Difference Between require() and include() in PHP

One of the most common questions I get asked by PHP beginners is, Why are there 4 ways to include a file on your page? There is include(), include_once(), require() and require_once(). What do these do? What's the difference between them? In this article, we're going to look at all these different functions and will talk about an example of when you need to use each of them. include() The include function is used in PHP when you want to include a file within the current process. It takes one argument which will be a string to the file path you want to include. The code inside the included file will then run when the include function is called. This…

Continue Reading
Contact Us
  • Nanyang Technological University, Singapore
  • root [at] haozhexie [dot] com