lets say we have a directory.
project/index.php
in index.php
<?php
require 'config/config.php';
echo ROOTPATH;
?>
project/config/config.php
<?php
define('ROOTPATH', rtrim(dirname(__FILE__), '\\/'));
?>
it will return like D:\Project Storage\Web Projects\www\project\config.
question:
is there an easy way to get the rootpath without puting it on the project folder ? ( i know this is supid but i cant stand to ask )
is there a way to get the \project\ ( root folder ) ? even if we change the folder location ?
Thanks
Adam Ramadhan
ps* please leave a comment if you dont understand what i mean.