PHP realpath() function

Definition and Usage

The realpath() function returns an absolute path.

The function deletes all symbolic links (such as '/./', '/../' and extra '/'), and returns the absolute path name.

If it fails, it returns false. For example, if the file does not exist.

Syntax

readlink(linkpath)
Parameter Description
linkpath Required. Specify the connection path to check.

Description

ໃນລະບົບ BSD, ຖ້າພຽງແຕ່ linkpath PHP ບໍ່ຈະກັບຄືນກັບລະບົບອື່ນຫຼືບໍ່.

Example

<?php
echo realpath("test.txt");
?>

Output:

C:\Inetpub\testweb\test.txt