你好。我正在尝试从Xlink创建的XML打开一个本地文件,我已将文件路径解析为$ resourcef actibal,看起来好像 file:/./birds/birds.txt 没有报价。请有人告诉我为什么我不能打开它。这是我的代码

$fh = fopen($resourceRef, 'r');
$theData = fread($fh, filesize($resourceRef));
fclose($fh);
echo $theData;

我得到这个错误

警告:fopen(file:/./ birds/feathers.txt)[function.fopen]:无法打开流:c: xampp htdocs htdocs test.php in Line 31

请有人指导我。

有帮助吗?

解决方案

您的URI看起来不正确,也应该是 file://birds/birds.txt 要不就 birds/birds.txt.

其他提示

参数应该是给定平台的合适路径(对于寡妇“ C: dir(...)”),或更正URI(file://(...))

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top