I have folder structure like this:
public_html
/index.php
outside
/other.php
I want in public_html/index.php
include file, wich is place in outside
folder. So, I want define outside folder path in public_html/index.php
file. I make this so:
index.php
$doc_root_upper = preg_replace("#/[^/]+$#", "", $_SERVER["DOCUMENT_ROOT"]);
$outside_folder = $doc_root_upper."/outside";
include outside_folder.'/other.php';
This works, but there is better practice for define webroot outside folder path?