Get just parent folder name
Posted: Thu Feb 21, 2008 5:16 pm
Hey Guys!~
I have a question:
I have a directory structure like this:
http://www.root.com/application/script.php
I need to figure out a way to get just the name of the parent folder (not the entire path) of a script. (in above, A quick function that returnd just 'application' would be great!)
This will allow me to define this:
define('CURRENT_APP', need this code...);
this will allow me to dynamically determine which application I am in and will help me redact the code.
What is the best way to do this?
I am familiar with all the functions that return the entire directory path you are in...
THANKS:D
ANDREW
I have a question:
I have a directory structure like this:
http://www.root.com/application/script.php
I need to figure out a way to get just the name of the parent folder (not the entire path) of a script. (in above, A quick function that returnd just 'application' would be great!)
This will allow me to define this:
define('CURRENT_APP', need this code...);
this will allow me to dynamically determine which application I am in and will help me redact the code.
What is the best way to do this?
I am familiar with all the functions that return the entire directory path you are in...
THANKS:D
ANDREW