开发者

PHP: translate virtual path to physical path

Is it possible to translate a server relative vir开发者_JAVA百科tual path to physical path in PHP?

e.g. if I have a url:

/home/index.php

then find the physical path of index.php somehow from some other script?


You're looking for realpath

$path = 'mydir/index.php';
echo realpath($path);


Prepend $_SERVER["DOCUMENT_ROOT"] to the script path.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜