Jump to content

writing to a new line in a .txt file


PolarBear

Recommended Posts

I've looked through the tutorials and searched the forums and can't seem to find anything on how to do this.I'm trying to write some string data to a .txt file and I would like the value of each variable I'm writing to file to be written to a new line.I can open the file with $file=fopen("MyFile.txt","w");then I tried thisInteresting, My post is getting truncated. Can't explain my question. Any ideas why?

Link to comment
Share on other sites

I've seen my posts get truncated too, I'm not sure why. This line will open the file in write mode:$file=fopen("MyFile.txt","w");Ingolme showed you how to add a line break to the text. If you want to append new text to the end of the file instead of overwriting everything, you can open it with the "a" mode instead of "w".

Link to comment
Share on other sites

Interesting, My post is getting truncated. Can't explain my question. Any ideas why?
Are you using Safari? That browser truncates my posts too, although in Opera it is fine.
Link to comment
Share on other sites

Archived

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

×
×
  • Create New...