[thelist] preserving line breaks in a text file

Paul Bennett Paul.Bennett at wcc.govt.nz
Mon Jan 15 15:10:16 CST 2007


Hi Mark,

If I understand you correctly, what you want to do is to have the text in the file exactly the same as the user-submitted text?

If so, shouldn't you just  be able to write your user-submitted data straight to the file? This way it will preserve the formatting of the original textarea entry without you needing to alter the input in any way...

If this does work, removing this line should do the trick:
$data=nl2br($data);

Paul



More information about the thelist mailing list