Page 1 of 1

line break in linux

Posted: Tue Nov 04, 2008 9:40 am
by saman_artorious
Hi,
i have installed LAMP and my sites are working fine.
i don't know how to use line break in linux. i have tried all the following choices but they do not work
\n
\r
\r\n
\n\r
i can only go to new line using html tag

(versionhp-5.1.6-20.el5_2.1)

any help would be thankful

Re: line break in linux

Posted: Tue Nov 04, 2008 2:55 pm
by Jade
Are you trying to do a newline on the page or within some kind of text formatting? I believe you're getting php confused with HTML or C++. The only way to do a formatted line break inside of php that will display on the page as an actual line break is to use HTML. <br/> or <p></p> tags.

The \n works with javascript, and it does work with php also, only you won't see the format change on the actual webpage. If you looked at the text (view source) you would see there were line breaks present, but again the only way to display those breaks to the user is to use HTML.