dink87522 Posted August 16, 2009 Share Posted August 16, 2009 I am getting the following error when I go to write.close to my file. "Warning: fwrite(): 2 is not a valid stream resource in /home/dinksoft/public_html/question3.php on line 513 Warning: fclose(): 2 is not a valid stream resource in /home/dinksoft/public_html/question3.php on line 514" I chmoded the file 777 permissions. I am writing an array to a file, could that be causing a problem? $stat_01_data[$stat_01_handle] = "h".$stat_01_handle.",".$stat_01_pieces[1].",".$stat_01_pieces[2]; fwrite($stat_01, $stat_01_data); fclose($stat_01); Link to comment https://forums.phpfreaks.com/topic/170465-solved-fclose-error/ Share on other sites More sharing options...
dink87522 Posted August 16, 2009 Author Share Posted August 16, 2009 ? Otherwise do do I print the contents of an array to a text file? Link to comment https://forums.phpfreaks.com/topic/170465-solved-fclose-error/#findComment-899208 Share on other sites More sharing options...
DarkendSoul Posted August 16, 2009 Share Posted August 16, 2009 Did you fopen? something like $stat_01 = fopen($file, "w"); Link to comment https://forums.phpfreaks.com/topic/170465-solved-fclose-error/#findComment-899214 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.