简体   繁体   English

为什么DIR无法获取目录路径? 它只是打印它

[英]Why DIR wont get the dir path? its just print it as it

the problem is when i use __ DIR __ in my php script, it prints __DIR__ exactly. 问题是当我在php脚本中使用__ DIR __时,它__DIR__精确打印__DIR__ so what is the cause of this problem? 那是什么原因造成的呢? and how can i solve it? 而我该如何解决呢? or at least is there any alternative way to do that? 或至少有其他替代方法可以做到这一点? i mean getting the real directory on the web server. 我的意思是在Web服务器上获取真实目录。 assuming that the server running on windows OS, if that could helps anyway. 假设服务器在Windows OS上运行,如果可以的话,还是可以的。

thank you 谢谢

您可以使用dirname(__FILE__)代替__DIR__

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM