Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/262.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP:将虚拟路径转换为物理路径_Php - Fatal编程技术网

PHP:将虚拟路径转换为物理路径

PHP:将虚拟路径转换为物理路径,php,Php,在PHP中是否可以将服务器相对虚拟路径转换为物理路径 e、 g.如果我有一个url: /home/index.php 然后以某种方式从其他脚本中找到index.php的物理路径?Prepend$\u SERVER[“DOCUMENT\u ROOT”]到您要查找的脚本路径。 谢谢benoit,这正是我想要的。 $path = 'mydir/index.php'; echo realpath($path);

在PHP中是否可以将服务器相对虚拟路径转换为物理路径

e、 g.如果我有一个url:

/home/index.php
然后以某种方式从其他脚本中找到index.php的物理路径?

Prepend
$\u SERVER[“DOCUMENT\u ROOT”]
到您要查找的脚本路径。


谢谢benoit,这正是我想要的。
$path = 'mydir/index.php';
echo realpath($path);