June 11th, 2000, 04:17 PM
Anyone know that how to find the current directory's name in php?
I need the php automatic to find its current directory's name.
June 11th, 2000, 09:26 PM
the Apache variable to get the script name and directory is $SCRIPT_FILENAME
that would let you get that and parse it out
June 12th, 2000, 07:05 AM
$dir = ereg_replace("**this_php_filename.php3", '',$PATH_TRANSLATED);
Is how I got it. (it's all one line)
**this_php_filename.php3 - is the name of the current file - the file contining the above line. We're just replacing it with nothing in the constant $PATH_TRANSLATED
Hope this helps.