代码中使用文本文件时代码中的参数无效

时间:2016-02-23 03:11:09

标签: php

我在执行php时遇到错误

PHP警告:

  

的file_get_contents(G:\ PleskVhostsxpertadvisorfree.com \的httpdocs \上传/ test.txt的):   无法打开流:无效的参数   G:\ PleskVhosts \ expertadvisorfree.com \ httpdocs \ force_download.php on   第31行

以下是代码

$file = file("G:\PleskVhosts\expertadvisorfree.com\httpdocs\upload/test.txt");
$file = trim($file);
file_put_contents($file, $result);

1 个答案:

答案 0 :(得分:0)

问题在于文件位置。您在地址中使用正常和倒置条。 \ /

您应该将文件的物理地址更改为正确的栏。

$file = file("G:\PleskVhosts\expertadvisorfree.com\httpdocs\upload\test.txt");