1-include one file includes more times but include_once one file includes only one times.
2-The include_once() statement includes and evaluates the specified file during the execution of the script. This is a behavior similar to the include() statement, with the only difference being that if the code from a file has already been included, it will not be included again.
3-If file not found then show warning error but continue execution of the script.
Example-
I have three files
1-header.php
2-config.php
3-functions.php
functions.php
function test(){
echo "Hello";
}
config.php
include_once('functions.php');
test();
header.php
include_once('functions.php');
include('config.php');
When open file header.php you will get error because config.php already includes functions.php
Copyright ©2022 coderraj.com. All Rights Reserved.