how can I get the current folder/directory name in PHP?
I have two pages on my site:
/about
and /help
This is my code (in about and help page):
<?php
echo dirname("index.php");
?>
I want it to return: 'about' if I am on about page. And return 'help' if I am on help page. But it returns nothing.
If I am on this path:
http://www.website.com/about/index.php
I want it to just return about