This function removes all symbolic links (like '/./', '/../' and extra '/') and returns the absolute pathname.
PHP realpath() Function has the following syntax.
realpath(path)
Parameter | Is Required | Description |
---|---|---|
path | Required. | Path to check |
This function returns FALSE on failure.
The realpath() function returns the absolute pathname.
Get the real path for a relative path
<?php
echo realpath("..\..\test.txt");
?>