How can I add line breaks in php?
My php cgi code includes writing out strings with "\n" at the end; I thought this would give me a new line, but that isn't happening. I am just getting one continuous string. I also tried "\n\r" but that did not make a difference.
Works on my mainframe server.
Works on my mainframe server.
2. Use PHP's built in nl2br function to insert HTML line breaks before all newlines. Why is this working on your own server? I can't say for sure why this works on your mainframe server without having more details. The first thing I would do is view the html source code on your mainframe server and check to see if you have some setup that automatically adds line breaks to your code. Also, you may be using the <pre> tag to output your text, and in that case, the new lines (\n) will print as you are expecting. If you have any further questions, feel free to update your question or post in the comments, and I'll be happy to assist further. Thanks! - Brad