Welcome Guest, Not a member yet? Register   Sign In
Writting to text file - new line
#1

[eluser]dazed[/eluser]
Hi Guys,

Been trying to work out how to add this but having a brain block.

I have collected a number of form inputs and have been adding them to a text file.

I have managed to work out how to add new lines to the code in html with nl2br or auto_typography(), the problem is I don't want <br /> all over my text file and if a user enters a carriage return in the form this does not transfer over to the text file.

Any ideas???

Cheers

D
#2

[eluser]dazed[/eluser]
Hello,

I thought that I would let you guys know how I managed to fix this issue in the end.

str_replace("\n","\r\n",$input)

I believe this is a Microsoft Notepad issue as it did not need this in Linux or Mac.

Hope my hours of head banging and perseverance helps someone else.

Cheers

Dazed




Theme © iAndrew 2016 - Forum software by © MyBB