PHP 7 realpath() Function
❮ PHP Filesystem ReferenceExample
Returns the absolute pathname:
<?php
echo realpath("test.txt");
?>
The output of the code above will be:
C:\Inetpub\testweb\test.txt
Definition and Usage
The realpath() function returns the absolute pathname.
This function removes all symbolic links (like '/./', '/../' and extra '/') and returns the absolute pathname.
Syntax
realpath(path)
Parameter | Description |
---|---|
path | Required. Specifies the path to check |
Technical Details
Return Value: | The absolute pathname on success, FALSE on failure |
---|---|
PHP Version: | 4.0+ |
PHP Changelog: | PHP 5.3: PHP 5.2.1: |
❮ PHP Filesystem Reference