문제

HI. i am trying to open a local file from xml created by xlink i have parsed the file path in $resourceRef variable and it looks like that file:/./birds/birds.txt without the quotes. Please someone tell me why i cant open it. here is my code

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

i get this error

Warning: fopen(file:/./birds/feathers.txt) [function.fopen]: failed to open stream: Invalid argument in C:\xampp\htdocs\test.php on line 31

Please someone guide me.

도움이 되었습니까?

해결책

Your URI doesn't look correct, it should be either file://birds/birds.txt or just birds/birds.txt.

다른 팁

Argument should be suitable path for a given platform (For widows "C:\\dir(...)" ), or correct URI ( file:// (...) )

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top