Clan Adverts

DarkForge Gaming

 

Get Directory Name of Current Script

Description: This short function will return the directory name of the current directory the script is running in.
Version: 1.0
Added on: 27 June 2007
Author: floppy
Difficulty Level: Very Easy
Views: 734
Detailed Profile

You could easily plug this into any script to return the current directory name. Extremely useful.

Code:
function getCurrentDirectory() {
   $path = dirname($_SERVER['PHP_SELF']);
   $position = strrpos($path,'/') + 1;
   return substr($path,$position);
}