Drezard Posted March 4, 2008 Share Posted March 4, 2008 I'm trying to open and read contents out of a file. Here is my code: <?php error_reporting ('E_ALL'); $path = 'list.txt'; $filestream = fopen($path, 'r') or die('die'); $contents = fread($filestream, 20) or die('dead'); echo $contents; ?> The only output of this page is 'Dead'. list.txt: myfilerandomcontents Whats wrong? Thanks, Daniel Quote Link to comment Share on other sites More sharing options...
KrisNz Posted March 4, 2008 Share Posted March 4, 2008 Just use file_get_contents() instead. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.