so say my php file "example.php" is in the directory "/user/example"
I thought that the line "$dir = getcwd();"
would save "/user/example"
to $dir
but instead it is saving the directory that the user running the script is in, e.g. if I run the script from the root directory, the $dir
variable will contain the root directory.
Is there a command I can use or a tip you can give me so that I can save the directory that the php file is in?