Jump to content

what the "\n" means?


co.ador

Recommended Posts

<br /> is a HTML, which will make things you can see in the page start a new line.

 

 

However if the text isn't formatted (and is a plain text file or the source of the HTML file) \n will start a new line with no characters visible.

 

so:

 

echo "<b>Test</b>\n<i>Hello!</i>"

 

Would print out:

 

Testhello

 

But the source of the file, would print:

 

<b>Test</b>
<i>Hello!</i>

 

Wheras:

 

echo "<b>Test</b><br /><i>Hello!</i>"

 

Would print:

 

Test

Hello!

 

But the source code would be:

 

<b>Test</b><br /><i>Hello!</i>

Link to comment
https://forums.phpfreaks.com/topic/194392-what-the-n-means/#findComment-1022550
Share on other sites

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.