How to insert new line character

Thread Solved
Reply

Join Date: Mar 2006
Posts: 13
Reputation: mithesh is an unknown quantity at this point 
Solved Threads: 0
mithesh mithesh is offline Offline
Newbie Poster

How to insert new line character

 
0
  #1
Jun 6th, 2007
<?php
printf("This is the first line. \n");
printf("This is the second line");
?>

This is the code but it isnt printing in new line.
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 3
Reputation: jac39 is an unknown quantity at this point 
Solved Threads: 1
jac39 jac39 is offline Offline
Newbie Poster

Re: How to insert new line character

 
0
  #2
Jun 6th, 2007
What you need to do is use the <br> HTML tag before each newline character. HTML doesn't accept newlines.
So, for example :

CODE
echo "this should be <br><br> a new line here <br> and here, too";

You won't need to do the carriage return for a new line in the page.
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 31
Reputation: DGStudios is an unknown quantity at this point 
Solved Threads: 3
DGStudios DGStudios is offline Offline
Light Poster

Re: How to insert new line character

 
0
  #3
Jun 6th, 2007
you can make carriage returns work. HOWEVER you have to use I beileve is the pre tag. And that is kinda of messy at times. You're better off using a br tag.

just keeping options open.
http://img.photobucket.com/albums/v6.../dgstudios.jpg
When all that is becomes one. That is the anomoly. That is... Death's Gate Studios (c) 2005
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 1
Reputation: ali_mma is an unknown quantity at this point 
Solved Threads: 0
ali_mma ali_mma is offline Offline
Newbie Poster

Re: How to insert new line character

 
0
  #4
Oct 22nd, 2007
tanks
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC