Returns the absolute path.
<?php echo realpath(“test.txt”); ?> |
The result of the code above will be:
C:\Inetpub\testweb\test.txt |
The realpath() function returns the absolute path by resolving all symbolic links, removing instances of ‘/./’, ‘/../’, and extra ‘/’ characters.
realpath(path) |
Parameter |
Description |
path |
Required. Specifies the path to be checked. |
Return Value: |
Returns the absolute pathname on success; FALSE on failure. |
PHP Version: |
4.0+ |
PHP Changelog: |
PHP 5.3: |