![](/style/images/good.png)
![](/style/images/bad.png)
PHP gets an absolute path with no symbolic links
source link: https://www.codesd.com/item/php-gets-an-absolute-path-with-no-symbolic-links.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
PHP gets an absolute path with no symbolic links
How do I get the absolute path to a file, without following symlinks.
/path/to/some/file
/path/to/some/link -> /path/to/some/file
/path/to/some/directory/
My current working directory is /path/to/some/directory/
and I go realpath('../link)
it returns /path/to/some/file
.
(I know realpath
is supposed to work this way)
Is there a function instead of realpath
that would return /path/to/some/link
there's also getcwd();
which I use quite often. Syntactically simpler.
Related Articles
PHP get the absolute path of the URL
how to find the complete target file (absolute path) of the symbolic link or the software link in python
Linux Kernel: Get a real path behind a symbolic link
How do I get the file path from the symbolic link?
A way to get an absolute path to the PHP file
With maven, how can I get the absolute path to where is my root pom?
How to get the executable path with getcwd when called from a symbolic link in C
How to get the absolute path of the specific header file?
Unable to get the absolute path of a file from $ File :: Find :: name - perl
How to get the absolute path of the currently selected item in QTreeView
How to get the absolute path relative to the root of the project without double slash?
How do I get the absolute path to the Eclipse installation directory?
Get the absolute path of the currently edited file in Eclipse
Getting the absolute path of a PathBuf
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK