How to get the currently executing directory of the currently executing file? This needs to return the currently executing file’s directory even if the file is included by another file. I landed on this:
$dir = str_replace(basename(__FILE__),"",__FILE__);
But is there a more straightforward way?
To get the directory of the file I use the dirname function like this :