url 1 - localhost/ocean/
url 2 - localhost/ocean/index.php
$file = basename($_SERVER['PHP_SELF']);
echo $file;
In both cases result is index.php
and that's ok.
Now, I need to get parent folder of current file.
So, in both cases result should be ocean
.
Any help?