【发布时间】: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