Latest web development tutorials

PHP realpath () function

PHP Filesystem Reference Manual Complete PHP Filesystem Reference Manual

Definition and Usage

realpath () function returns the absolute path.

This function deletes all symbolic links (such as '/./', '/../' and extra '/'), and returns the absolute pathname.

If this fails, the function returns FALSE.

grammar

realpath(path)

参数 描述
path 必需。规定要检查的路径。


Examples

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

The code above will output:

C:Inetpubtestwebtest.txt


PHP Filesystem Reference Manual Complete PHP Filesystem Reference Manual