file_get_contents函数。它的路径是否支持反转目录?

时间:2013-03-12 15:55:52

标签: php

基本上

file_get_contents('test.php')

完美无缺。但是,

file_get_contents('/../test.php')

结果为"file_get_contents(/../xx.php) [function.file-get-contents]: failed to open stream: No such file or directory"

目录结构正确。

1 个答案:

答案 0 :(得分:3)

你说目录结构是正确的,但读起来仍然很奇怪:

file_get_contents('/../test.php')

如果没有前导斜杠,你确定它不应该如下:

file_get_contents('../test.php')