不灭的焱

加密类型:SHA/AES/RSA下载Go
复合类型:切片(slice)、映射(map)、指针(pointer)、函数(function)、通道(channel)、接口(interface)、数组(array)、结构体(struct) Go类型+零值nil
引用类型:切片(slice)、映射(map)、指针(pointer)、函数(function)、通道(channel) Go引用

作者:AlbertWen  添加时间:2013-04-09 00:48:14  修改时间:2025-11-05 06:23:31  分类:11.PHP基础  编辑

定义和用法

realpath() 函数返回绝对路径。

该函数删除所有符号连接(比如 '/./', '/../' 以及多余的 '/'),返回绝对路径名。

若失败,则返回 false。比如说文件不存在的话。

例如:

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

输出:

C:\Inetpub\testweb\test.txt

又如:

<?php
$str = "d:\My Documents\1\";
echo realpath($str);
?>

输出:

D:\My Documents\1
 也就是说,物理路径后面是不带 “” 或 “/” 的!