First of all I would like apology if this question has already been answered, I'm searching for two days with no luck.
Here is my setup:
I have 2 php files, in 2 different folders:
AAA/1.php AAA/BBB/CCC/2.php
"2.php" is included in "1.php".
Since I need to use "2.php" in several different folders, I need it to be able to know in what folder he's localized. So in "2.php" I should have some code like:
$directory = [whatever code I need to know where I am];
So in the above example, the relative path should be: BBB/CCC
I tried with several functions and coding I found but I can only get the full server path to "1.php".
Can anyone help me?