Or you could also try looking at the functions dirname() and basename() in the manual. dirname() will return your the directory part of the path without the filename, i.e.
$current_directory = dirname($PHP_SELF);
$current_directory will now contain the directory path of the current script from the root of the webserver.
To get the full path on disk:
$current_directory = dirname($DOCUMENT_ROOT.$PHP_SELF);
This will give you the full path on disk.
G'luck,
Jack