Change print line: Does \n work?

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
dr.php
Forum Newbie
Posts: 2
Joined: Mon Sep 22, 2008 4:45 am

Change print line: Does \n work?

Post by dr.php »

I am a beginner in php. I tried \n in a print line but it didn't work.
Also \n didn't work with echo. Why and how can order php to change line? :)
User avatar
pcoder
Forum Contributor
Posts: 230
Joined: Fri Nov 03, 2006 5:19 am

Re: Change print line: Does \n work?

Post by pcoder »

Use <br> instead of \n. It works.
For example:

Code: Select all

 
echo "HELLO<BR>";
echo "WORLD";
 
dr.php
Forum Newbie
Posts: 2
Joined: Mon Sep 22, 2008 4:45 am

Re: Change print line: Does \n work?

Post by dr.php »

thanks
Post Reply