Sorry for the question, as it can be answered many times earlier, but my question is a little different
I have a tree like
/var/www/path/to/my/app/
(I refer to inc / include.php from index.php,
include "inc/include.php";
)
but in include.php, I need to get the absolute path to the root of APPLICATION, not DOCUMENT_ROOT so as a result I need to be able to use this command
//inc/include.php
include(APP_ROOT."/b.php");
I repeat, I DO NOT WANT TO CALL LOVE
include("../b.php");
is there a native function, if possible?
UPDATE:
I want to get PATH from PHP, since any open source must have this path detection Why? If I wanted to include inc / include.php from ajax / 1 / somethiing.php it would succeed, but inc / include.php would try to include ajax / b.php instead of b.php
For Pekka:
I have this tree
Now take a look. From index.php you will call inc / include.php
include("inc/include.php");
include("../b.php");
, ! include inc/include.php ajax/1/ajax.php,
include("../../inc/include.php");
,
../b.php
.. /../b.php , , inc/include.php
?