realpath

realpath

  • 返回绝对路径。

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

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

$str = '/home/wwwroot/default/yaf/yaf_model/public/../';
echo realpath($str);
/home/wwwroot/default/yaf/yaf_model
posted @ 2019-12-25 10:44  盘思动  阅读(294)  评论(0编辑  收藏  举报