定义和用法
realpath() 函数返回绝对路径。
该函数删除所有符号连接(比如 '/./', '/../' 以及多余的 '/'),返回绝对路径名。
若失败,则返回 false。比如说文件不存在的话。
语法readlink(linkpath)
linkpath | 必需。规定要检查的连接路径。 |
在 BSD 系统上,如果仅仅是 linkpath 不存在的话,PHP 并不会像其它系统那样返回 false。
例子
<p class="sycode"> <p class="sycode"> <? php echo realpath ( " test.txt " ); ?> </p> </p><p> </p><p><span>立即学习</span>“<a href="https://pan.quark.cn/s/7fc7563c4182" style="text-decoration: underline !important; color: blue; font-weight: bolder;" rel="nofollow" target="_blank">PHP免费学习笔记(深入)</a>”;</p>
输出:
<p class="sycode"> <p class="sycode"> C : \Inetpub\testweb\test . txt </p> </p><p> </p><p><span>立即学习</span>“<a href="https://pan.quark.cn/s/7fc7563c4182" style="text-decoration: underline !important; color: blue; font-weight: bolder;" rel="nofollow" target="_blank">PHP免费学习笔记(深入)</a>”;</p>
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号