how to use \n,\t in php?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tuanict_vn
Forum Newbie
Posts: 1
Joined: Sun Oct 10, 2010 10:52 am

how to use \n,\t in php?

Post by tuanict_vn »

hi all! i'm a beginner in Php, and i have a problem with: \n,\t. I want to use it for newline and tab, but it is show in browser of me when i write:
print "Wellcome to VietNam!\n.Hello!";
Please help me! Thanks.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Re: how to use \n,\t in php?

Post by s.dot »

Your browser is rendering the page as HTML. Your new line is there. View the source of the page to see it.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
jabbaonthedais
Forum Contributor
Posts: 127
Joined: Wed Aug 18, 2004 12:08 pm

Re: how to use \n,\t in php?

Post by jabbaonthedais »

Yeah the new line is working, but it only affects the page source, not how it appears in the browser. To make a new line in the browser you need to use html like <br>
Post Reply