你可以看到
i put this at D:\Project Storage\wnmp\www\folder\scriptfolder
example D:\Project Storage\wnmp\www\folder
define('SAMPLE1', realpath(dirname(__FILE__).'/..'));
example D:\Project Storage\wnmp\www\somefolder
define('SAMPLE2', realpath(dirname(__FILE__).'/../somefolder/'));
how do we put like D:\Project Storage\wnmp\www\folder\scriptfolder/ ? ( add '/') ?
define('SAMPE3', realpath(dirname(__FILE__).'/')); it seems its not working.
感谢您查看
Adam Ramadhan
答案 0 :(得分:3)
realpath()
永远不会添加尾部斜杠,因为它不是路径的一部分。
将其添加到realpath语句之外
realpath(dirname(__FILE__)).'/'
或使用时
$path = ROOT."/xyz.php";