The PHP realpath path function detects if the target file (or folder) the $path points to is real, equivalent to calling the File_exists ($path).
If the destination file exists and is not a symbolic connection (called "Shortcut" in Windows), the absolute pathname of the file is returned and does not contain '/./' or '/'. /’。
If the destination file is a symbolic connection or does not exist, Realpath () returns false.
Var_dump (Realpath ('./test.php '));
If the test.php file can be found under the./path, the output is:
String ' E:dropboxmy dropboxcodephptest.php ' (length=48)
If the test.php is a symbolic connection found under the./path, the output is:
Boolean false
If the test.php file cannot be found under the./path, the output is:
Boolean false
If executed under the Windows platform, the downstream code executes as follows, because in Windows, the slash (/) and backslash () can be used as directory separators.
Var_dump (Realpath ('. test.php '));
I hope the above-mentioned PHP realpath path function knowledge can be helpful to everyone.
http://www.bkjia.com/PHPjc/446153.html www.bkjia.com true http://www.bkjia.com/PHPjc/446153.html techarticle The PHP realpath path function detects if the target file (or folder) the $path points to is real, equivalent to calling the File_exists ($path). If the destination file exists and is not a symbolic connection ...