Jump to content

special characters don't work (\n, \t, ...)


Dergam

Recommended Posts

It doesn't work because you're looking at it with a browser, which anticipates HTML.  \n is meaningless to a browser (at least, in terms of what it renders to the screen).  Your normal white space characters won't work.  Instead, use <br />, the HTML tag for a line break.

Note that your thread title fell into the classic trap of new programmers.  You said "special characters don't work."  That's not the problem.  The problem is "I don't see special characters when I expect to see them."  The problem is that you're viewing your output incorrectly (in a browser, rather than plain text), not anything to do with PHP.  Make sure you define the question properly, it may help you understand a way to fix it on your own.

Dergam, I wasn't attempting to scold you.  The phrasing lead me to assume something about the way you were thinking about the problem.  If you were thinking incorrectly, it would be good for you to think a different way so you could easily solve the problems.

 

Good that you got it working, and keep at it!  you're welcome here.

Archived

This topic is now archived and is closed to further replies.

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