为什么在 PHP 中 realpath() 时该字符串会返回 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)
有人知道为什么这会对我返回 false 吗?
Here is my string
$newPath = '/~new/assets/js/../packages/prettyphoto/js/jquery.prettyPhoto.js';
Now check this output
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
嘿,你是提供手动链接<的人/a> 在你的 最后一个问题!不要只是链接它,而是阅读它。 :)
Hey, you were the guy who provided the manual link in your last question! Don't just link it, read it. :)
添加来查找
您可以通过在声明后 。 手册页<中描述了可能的错误/a>.
You can find out by adding
After your statement. The possible errors are described in the man page.
快速浏览一下 php.net 的 realpath 定义可以看到以下注释,这可能是相关的:
A quick look on the php.net definition of realpath shows this note, which may be pertinent: