Re: Beginner's attempt fails

From: Date: Tue, 17 Oct 2000 16:00:35 +0000
Subject: Re: Beginner's attempt fails
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-20656@lists.php.net to get a copy of this message
this is not what you want but fyi : function nl2br() : http://php.net/manual/function.nl2br.php does such conversions so : $string = "I am text\nAnd I am more text\nAnd more"; echo $string; As you now know, that will put new lines in your source code but not to browser. But, if you did this $newstring = nl2br($string); echo $newstring; Then it would convert each \n into a <br> and this would be as such in browser. But you don't want to do this here as running all your text through functions is not optimal. You can read about \n , \t etc. here : http://www.php.net/manual/language.types.string.php Have a great day, Philip Olson -- without php my name would be ili ! -- http://www.theprojects.org/ On Tue, 17 Oct 2000, Marc Antony Vose wrote: > >Well, in the end I got the php 4.0.2 module compiled into Apache > >1.3.12 on Linux. But in the second little document I wrote the > >linefeed escape doesn't work. The '\n' disappears from the text > >but the lines don't get broken. See output below, and the pgp > >that produced it further below. > > > > > browsers ignore linefeed characters. > > they read HTML. so you need to send out a <BR> if you want the lines broken. > > if you view the source of the page, however, i bet you'll see that > PHP's sending out the line break. > > -- > Marc Antony Vose > http://www.suzerain.com/ > > Democracy is government by Squawk. > -- Kenneth Boulding > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#20656) next »