Dev Diaries WD logo Dev Diaries WD
PHP INTERVIEW · EP 03
PHP INTERVIEW · Episode 03

What’s the difference between include and require?

And when to use include_once / require_once

ep3_require_vs_include.php
<?php
// Your code will go here.
include("includes/include-test.php"); //no error success
require("includes/include-test.php"); //no error success

include("includes/include-tests.php"); //warning, no success
require("includes/include-tests.php"); //fatal error, no success
Output
Output for this tutorial goes here.

Show the actual printed result of the code above.

Watch the full episode

Watch on YouTube