Jump to content

Why can't I read this file?


jkies00

Recommended Posts

Hello,

I've opened a directory, and I'm trying to read a text file, but I can't get it to read:

[code]
$subFolders = opendir($dir); 
$myfile = "info.txt";
$fh = fopen($myFile, 'r');
$theData = fread($fh, 5);
fclose($fh);
echo $theData;
[/code]

The directory I've opened does contain the info.txt file I'm looking for.  I'm able to view it if I list the contents of the folder.  Why can't I read it?  The above code returns no output.

~jeff
Link to comment
https://forums.phpfreaks.com/topic/19825-why-cant-i-read-this-file/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.