On 12/19/06, Stephen Rider <evolt_org at striderweb.com> wrote: > I'm trying to figure out a straightforward way to set a PHP variable > to a particular directory in a path. > > For example: I have http://www.example.com/main/something/inner/ > index.php > The path can change, though. Specifically, the directory "something" > is arbitrary -- the script could be running in http://www.example.com/ > main/whatever/inner/ and so forth. > > When the script runs, I want to set a variable to = "something", or > whatever that directory name happens to be. $parts = explode('/', $_SERVER['PHP_SELF']); print_r($parts); -- Matt Warden Cleveland, OH, USA http://mattwarden.com This email proudly and graciously contributes to entropy.