fopen(c:\dorian.txt): failed to open stream: No such file or directory
fopen(c:\dorian.txt): failed to open stream: No such file or directory
这个是如何重复的吗?\n“can-i-read-a-txt-file-with-php”中的解决方案对我无效,因为代码本身没问题,错误是由于文件路径引起的,我尝试了不同的方法,所以才来这里寻求帮助。\n我无论如何都试了那里的代码,仍然出现了相同的问题;\n警告:无法打开流(C:\\dorian.txt):没有这样的文件或目录,位于C:\\xampp\\htdocs\\filestats\\index.php的第9行\n警告:对于C:\\dorian.txt,文件大小的获取失败,位于C:\\xampp\\htdocs\\filestats\\index.php的第10行\n警告:fread()期望参数1为资源,而给出的是布尔值,位于C:\\xampp\\htdocs\\filestats\\index.php的第10行\n警告:fclose()期望参数1为资源,而给出的是布尔值,位于C:\\xampp\\htdocs\\filestats\\index.php的第11行\n我试着在PHP上尝试这个简单的代码,但无法弄清楚问题出在哪里。\n我想读取文件中的内容。\n以下是代码。\n
\n我还尝试了将dorian.txt放在不同目录中,并从文件属性中复制粘贴了它。