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

WBOY
Release: 2016-06-06 20:32:56
Original
1019 people have browsed it

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

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

<code>$ff =  "c:\\mywww\\www.bin3d.cn\\temp_upload\\files\\xxxx.txt";
echo file_get_contents($ff);
</code>
Copy after login
Copy after login

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

<code>$file = "xxxx.txt";
$ff =  "c:\\mywww\\www.bin3d.cn\\temp_upload\\files\\".$file."";
echo file_get_contents($ff);
</code>
Copy after login
Copy after login

错误信息是:

<code>Warning:  
file_get_contents(c:\mywww\www.xxx.cn\temp_upload\files\xxxx.txt): 
failed to open stream: No such file or directory in.... 
</code>
Copy after login
Copy after login

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

回复内容:

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

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

<code>$ff =  "c:\\mywww\\www.bin3d.cn\\temp_upload\\files\\xxxx.txt";
echo file_get_contents($ff);
</code>
Copy after login
Copy after login

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

<code>$file = "xxxx.txt";
$ff =  "c:\\mywww\\www.bin3d.cn\\temp_upload\\files\\".$file."";
echo file_get_contents($ff);
</code>
Copy after login
Copy after login

错误信息是:

<code>Warning:  
file_get_contents(c:\mywww\www.xxx.cn\temp_upload\files\xxxx.txt): 
failed to open stream: No such file or directory in.... 
</code>
Copy after login
Copy after login

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

<code>php</code><code>$file = "xxxx.txt";
$ff =  "c:\\mywww\\www.bin3d.cn\\temp_upload\\files\\".$file;
echo file_get_contents($ff);
</code>
Copy after login
Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template