定义和用法
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>
<div class="aritcle_card">
<a class="aritcle_card_img" href="/ai/1098">
<img src="https://img.php.cn/upload/ai_manual/000/000/000/175680092332148.png" alt="怪兽AI数字人">
</a>
<div class="aritcle_card_info">
<a href="/ai/1098">怪兽AI数字人</a>
<p>数字人短视频创作,数字人直播,实时驱动数字人</p>
<div class="">
<img src="/static/images/card_xiazai.png" alt="怪兽AI数字人">
<span>44</span>
</div>
</div>
<a href="/ai/1098" class="aritcle_card_btn">
<span>查看详情</span>
<img src="/static/images/cardxiayige-3.png" alt="怪兽AI数字人">
</a>
</div>
输出:
<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号