Reputation: 22810
im very sorry to ask a very simple question, its seems im not understanding define path properly
as you can see
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.
thanks for looking in
Adam Ramadhan
Upvotes: 0
Views: 52
Reputation: 449385
realpath()
will never add a trailing slash because it's not a part of the path.
Either add it outside the realpath statement
realpath(dirname(__FILE__)).'/'
or when you use it
$path = ROOT."/xyz.php";
Upvotes: 3