Jump to content

[SOLVED] Text file problems?


waynew

Recommended Posts

Two problems:

 

1.) filesize() expects the filename not the resource handler.

 

2.) If you want to read existing data, you'll need r, not w -- using w wipes the file first. (see: http://www.php.net/fopen)

 

So:

 

$fp = fopen("C:\hello.txt", 'r+'); 
$letter = fread($fp, fileszie("C:\hello.txt"));

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.