PHP8.1.21版本已发布
vue8.1.21版本已发布
jquery8.1.21版本已发布

php的file_get_contents的问题,很奇怪,不知道怎么解决!

原创
2016-06-06 20:32:56 742浏览

在使用file_get_contents时,出现奇怪的问题。

如果使用如下代码,可以运行:

$ff =  "c:\\mywww\\www.bin3d.cn\\temp_upload\\files\\xxxx.txt";
echo file_get_contents($ff);

但是,如果是下面的代码就出现错误信息:

$file = "xxxx.txt";
$ff =  "c:\\mywww\\www.bin3d.cn\\temp_upload\\files\\".$file."";
echo file_get_contents($ff);

错误信息是:

Warning:  
file_get_contents(c:\mywww\www.xxx.cn\temp_upload\files\xxxx.txt): 
failed to open stream: No such file or directory in.... 

请问是什么问题呢?好烦人啊

回复内容:

在使用file_get_contents时,出现奇怪的问题。

如果使用如下代码,可以运行:

$ff =  "c:\\mywww\\www.bin3d.cn\\temp_upload\\files\\xxxx.txt";
echo file_get_contents($ff);

但是,如果是下面的代码就出现错误信息:

$file = "xxxx.txt";
$ff =  "c:\\mywww\\www.bin3d.cn\\temp_upload\\files\\".$file."";
echo file_get_contents($ff);

错误信息是:

Warning:  
file_get_contents(c:\mywww\www.xxx.cn\temp_upload\files\xxxx.txt): 
failed to open stream: No such file or directory in.... 

请问是什么问题呢?好烦人啊

php$file = "xxxx.txt";
$ff =  "c:\\mywww\\www.bin3d.cn\\temp_upload\\files\\".$file;
echo file_get_contents($ff);
声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。