为什么在realpath()中,此字符串在PHP中将返回false? [英] Why would this string be returning false in PHP when realpath()'d?

查看:569
本文介绍了为什么在realpath()中,此字符串在PHP中将返回false?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的琴弦

$newPath = '/~new/assets/js/../packages/prettyphoto/js/jquery.prettyPhoto.js';

现在检查此输出

var_dump($newPath); // string(64) "/~new/assets/js/../packages/prettyphoto/js/jquery.prettyPhoto.js"
var_dump(realpath($newPath)); // bool(false)

有人知道为什么这对我会返回假吗?

Does anyone know why this would be returning false on me?

推荐答案

嘿,是提供 手动链接 在您的

Hey, you were the guy who provided the manual link in your last question! Don't just link it, read it. :)

realpath()在失败时返回FALSE,例如如果文件不存在.

realpath() returns FALSE on failure, e.g. if the file does not exist.

这篇关于为什么在realpath()中,此字符串在PHP中将返回false?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆