PHP文件\u获取\u内容文件名以特殊字符开头

PHP文件\u获取\u内容文件名以特殊字符开头,php,file-get-contents,Php,File Get Contents,我试图了解当我使用file\u get\u内容时发生了什么 使用filename参数 我从什么开始?或或者任何特殊的字符 它正在成功地工作,但有点奇怪。 这就是我所做的 heogi@ubuntu:~$ php -a Interactive mode enabled php > $a = file_get_contents("../../index.html"); PHP Warning: file_get_contents(../../index.html): failed to op

我试图了解当我使用file\u get\u内容时发生了什么 使用filename参数 我从什么开始?或或者任何特殊的字符 它正在成功地工作,但有点奇怪。 这就是我所做的

heogi@ubuntu:~$ php -a
Interactive mode enabled

php > $a = file_get_contents("../../index.html");
PHP Warning:  file_get_contents(../../index.html): failed to open stream: No such file or directory in php shell code on line 1
php > $a = file_get_contents("?../../index.html");
php > echo $a;
hello test;

heogi@ubuntu:~$ pwd
/home/heogi

heogi@ubuntu:~$ ls -l
total 28
drwxr-xr-x  8 root  root   4096 Sep 18 16:36 dirsearch
-rw-rw-r--  1 heogi heogi 12918 Nov 19 10:56 index.html
drwxr-xr-x 11 root  root   4096 Sep 18 16:35 sqlmap-dev
drwxr-xr-x  4 root  root   4096 Sep 18 16:13 Sublist3r

heogi@ubuntu:~$ php -version
PHP 7.0.33-0ubuntu0.16.04.7 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.33-0ubuntu0.16.04.7, Copyright (c) 1999-2017, by Zend Technologies
为什么它只从特殊字符开始工作?
甚至它也需要更改目录为什么?

看起来像
index.html
就在您的同一个文件夹中。为什么要从另一个文件夹打开它?这只是一个测试,我的意思是为什么$a=file\u get\u contents(“/home/heogi/index.html”)$a=file_get_contents(“?../../../index.html”);打开的文件与/home/heogi/index.html返回的文件相同:var_dump(realpath(“?../../index.html”);
php>var_dump(realpath(“?../../index.html”);bool(false)
它返回false,我想?../../is仅在文件中有效\u get\u contents文件名参数
file\u get\u contents
可以检索URL,我想知道它是否在开始时看到了?并不知怎的认为它是一个URL片段并将其发送到本地主机或其他地方。