Jump to content

Funny Line Feeds


stevepatd

Recommended Posts

I have a php file that outputs text to a standard ASCII text file.  I put a \n at the end of each line as it writes out.  I then have another php file that reads these generated files and does something with the data.  The problem is, when the second file reads the generated data it doesn't like the \n.  When I edit the generated files with Notepad instead of seeing a carriage return/line feed making the data line up in nice neat columns, I see a little square in place of the \n and the text continues on the same line wrapping at the edge of the screen.

WHat command should I be using to prevent this?

I'm running on a Windows server, either Win2000 or 2003.

Thx,
Steve

Link to comment
Share on other sites

If the file is being created in unix and read in windows, you can probably fix it by using \r\n for linefeed instead of \n.  If it's some other combination, the solution will be different.  nl2br() is for displaying in html, so it doesn't help here.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • 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.