Jump to content

escape character


blackcat

Recommended Posts

I dont know why the browser doesn't present the php string with some escape character like \n,\t....

For example: the string "Name\nAddress" should be printed out like

Name

Address

instead it prints out "Name Address".I tried other ones and do not work. Anyone know why?

 

Link to comment
Share on other sites

You need to use nl2br()  www.php.net/nl2br

 

That should solve your issue for the line break.

 

Why it is doing that is because html does not notice the line break on the gui portion of the page. It will behind the scenes in the source. But in order to have it display with the break you need to convert the \n to < br />

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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