Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP code

Status
Not open for further replies.

BettyJo50

Technical User
Apr 25, 2002
47
0
0
US
I am just learning PHP. I have not come across anything that explains what "\n" is or what it does. Can someone please explain this to me?

Thanks!!
 
It's a newline character.

<?php
echo &quot;Line 1\nLine 2&quot;;
?>

will show up as:

Line 1
Line 2

in your html source

(instead of &quot;Line1Line2&quot; when omitting the \n)
It's not a lie if YOU believe it ;-)
 
You definately want to use &quot;\n&quot; when you're having PHP print/echo anything for you. That way when you &quot;view source&quot; in your browser you'll see nice rows of html/text, rather than one long line of indeciferable kaka.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top