【问题标题】:Error using file_get_contents() in PHP在 PHP 中使用 file_get_contents() 时出错
【发布时间】:2014-12-30 09:54:38
【问题描述】:
echo "Enter file path:";
$filePathV2C = fgets(STDIN);
$fileString=file_get_contents($filePathV2C);
print $fileString;

我提供的输入是:c:\phpFile\myfile.v2c

但我收到以下错误:

警告:file_get_contents(file://C:/php/myfile.v2c ): 无法打开流:C:\php_CloudWSsample\Sample.php 中的参数无效

【问题讨论】:

  • 尝试不使用协议file://
  • 试过但仍然无法正常工作。如果我将文件名直接放在 file_get_contents 它就像 file_get_contents("c:\php\myfile.v2c");但是使用变量名它不起作用。

标签: php file-get-contents


【解决方案1】:

尝试输入:“c:/phpFile/myfile.v2c”

【讨论】:

    猜你喜欢
    • 2011-07-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-12-05
    • 1970-01-01
    • 2019-03-05
    • 1970-01-01
    相关资源
    最近更新 更多