PHP Include File Statement

include 'myfile.php';


PHP include file from parental directory (folder) - relative path

include(dirname(__DIR__).'/../ myfile.php');



PHP Include File from ROOT directory

include($_SERVER['DOCUMENT_ROOT']."/myfile.php");


PHP Include File deeper directory then ROOT - absolute path

$root = realpath($_SERVER["DOCUMENT_ROOT"]);
include "$root/folder1/folder2/myfile.php";