Jump to content

writing to a new line in a .txt file


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 post
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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...