Line Break Problem in .txt file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
habib009pk
Forum Commoner
Posts: 43
Joined: Sun Jul 05, 2009 11:28 pm

Line Break Problem in .txt file

Post by habib009pk »

Dear Friends

I am facing a little problem, i am creating a file in which data came from a form through different textareas. now data can be writen in a file and the this file can be downloaded in our local machine.

Now the problem is that when i cancatenate all posted values. with '\n' or '\r' then no line break included in my txt file..

it is working on my local system with that variable

$space="


";

but when i upload it on the live server than it will never work

Please help me regarding that when i write data in a txt file through fopen then line breaks also included in my text file on live server

Thanks And Regards
frao_0
Forum Commoner
Posts: 27
Joined: Sat Aug 08, 2009 3:52 am
Location: Toulouse, France

Re: Line Break Problem in .txt file

Post by frao_0 »

could be lots of things. First, is your server hosted on *nix or Windows? They treat line breaks differently. I did not fully understand your questions. So you are passing a textarea value to a POST form that will then save the passed value into a file through fopen, right? Do you want the line breaks symbols \r and \n to appear? Are they appearing all along the process? If not, at which step do they disappear? Maybe show us some code.
Post Reply