is there an easy way to get the name of the containing folder of a script
I know it is possible by manipulating strings using a combination of REQUEST_URI, SCRIPT_FILENAME and dirname - haven't actually coded it but know it won't be that hard.
Basically what I want to get from any one of these urls:
http://localhost/galleries/
http://localhost/galleries/image.php?blah&blah&blah
http://localhost/galleries/displayimage.php?blah
is the string
"galleries"
this code will execute on every page of my site so I would like the most efficient and simplest way of doing this.
any help will be met with much thanks and praise.