I need to get the current directory name to be able to use it as a variable on the page.
For example, if a user accesses:
http://www.example.com/demo/
I need to get "demo" from the url in order to use it as a variable.
How can I do that?
Would it be any different when the page name is specified in the url since I don't need the page name, just the directory name. For example:
http://www.example.com/demo/gotcha.php
I still only need the directory name: demo
Thanks in advance for your help.