line break in linux

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
saman_artorious
Forum Newbie
Posts: 3
Joined: Sat Nov 01, 2008 1:48 pm

line break in linux

Post 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
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Re: line break in linux

Post 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.
Post Reply