Thread: fclose
View Single Post

  #1 (permalink)  
Old 10-28-2004
Neudeck Werner
 
Posts: n/a
Default fclose

Hello,
I have these lines:
$fp = "test.txt";
if ($datei = fopen ($fp, "r")) {
while (!feof ($datei)) {
$zeichen = fgetc ($datei);
echo ($zeichen);
}
fclose($fp);
}

The file is opened correctly and the content of the file is shown. But
below the content there is the error:
Warning: fclose(): supplied argument is not a valid stream resource in
........... on line 9
Where is the mistake?
Thanks Werner

Reply With Quote