Fira Posted September 25, 2006 Share Posted September 25, 2006 Simple question - how can I end a block of text with a linebreak? Link to comment https://forums.phpfreaks.com/topic/21921-linebreaks-in-php/ Share on other sites More sharing options...
trq Posted September 25, 2006 Share Posted September 25, 2006 [code=php:0]echo "this is a block of text\n";[/code] Link to comment https://forums.phpfreaks.com/topic/21921-linebreaks-in-php/#findComment-97926 Share on other sites More sharing options...
Fira Posted September 25, 2006 Author Share Posted September 25, 2006 [quote]<?phpecho "text1\n";echo "text2\n";?>[/quote]This code results in [quote]text1 text2[/quote]Is it supposed to? Link to comment https://forums.phpfreaks.com/topic/21921-linebreaks-in-php/#findComment-97929 Share on other sites More sharing options...
trq Posted September 25, 2006 Share Posted September 25, 2006 If you view it in a browser it will. View the source however and you will see the linebeaks. If its html linebreaks you want, well.... that has nothing to do with php really.[code=php:0]<?phpecho "text1<br />";echo "text2<br />";?>[/code] Link to comment https://forums.phpfreaks.com/topic/21921-linebreaks-in-php/#findComment-97934 Share on other sites More sharing options...
Fira Posted September 25, 2006 Author Share Posted September 25, 2006 Yes, that's what I needed. Thanks. Link to comment https://forums.phpfreaks.com/topic/21921-linebreaks-in-php/#findComment-97958 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.