Including a file from root directory (PHP)

This is how to include a file from your root directory of your host provider. You will find this useful if you have files that you need to include from sub folders.

$root = realpath($_SERVER["DOCUMENT_ROOT"]);
include "$root/ExampleFolder/functions.php";

Change this


to the required destination of the file.

There are no comments yet, but you can be the first

Comments are closed.

27 Dec / 2011


There is no tags