include
keyword
01_include.php
<?php
$x++;
01.php
<?php
$x = 0;
include '01_include.php';
include '01_include.php';
echo $x;
include_once
keyword
01b.php
<?php
$x = 0;
include_once '01_include.php';
include_once '01_include.php';
echo $x;
01c.php
<?php
$x = 0;
include '01_nonexistent.php';
include '01_include.php';
echo $x;
require
does the same as include
yet it won't give a notice but will result in a fatal error and stop the process
02.php
<?php
$x = 0;
require '02_nonexistent.php';
echo $x;
require_once
doesrequire
or require_once
instead of include*
config.php
file and define
all variables into it
<?php
define('MAIL_SERVER', 'localhost');
define('MAIL_PORT', 25);
define('DB_HOST', 'localhost');
define('DB_USER', 'root');
define('DB_PASS', 'Azerty123');
define('DB_NAME', 'world');
// EOF
config.php
is the only file that may be changed when publishing a site onto a server
isValidImageExtension()
that checks whether a filename ends in .jpg
/.jpeg
/.gif
.png
too? You'll edit all files?functions.php
and put all often used functions in it
includes/
subfolder to store config.php
and functions.php
in
config.php
functions.php
includes/classes/