DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   PHP (http://www.daniweb.com/forums/forum17.html)
-   -   How to insert new line character (http://www.daniweb.com/forums/thread80207.html)

mithesh Jun 6th, 2007 6:10 am
How to insert new line character
 
<?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.

jac39 Jun 6th, 2007 6:22 am
Re: How to insert new line character
 
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.

DGStudios Jun 6th, 2007 12:27 pm
Re: How to insert new line character
 
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.

ali_mma Oct 22nd, 2007 11:43 pm
Re: How to insert new line character
 
tanks


All times are GMT -4. The time now is 4:38 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC