Php/func filesystem realpath
来自菜鸟教程
PHP realpath()函数
例
返回绝对路径名:
<?php
echo realpath("test.txt");
?>
上面代码的输出将是:
C:\Inetpub\testweb\test.txt
定义和用法
realpath()函数返回绝对路径名。
此函数删除所有符号链接(如“ /./”、“/../”和多余的“ /”)并返回绝对路径名。
句法
realpath(path)
参数值
| 参数 | 描述 |
|---|---|
| path | 需要。指定要检查的路径 |
技术细节
| 返回值: | 成功时的绝对路径名,失败时的绝对路径名 |
| PHP版本: | 4.0+ |
| PHP更新日志: | PHP 5.3: PHP 5.2.1: |