Jump to content

Archived

This topic is now archived and is closed to further replies.

Fira

Linebreaks in PHP?

Recommended Posts

[code=php:0]
echo "this is a block of text\n";
[/code]

Share this post


Link to post
Share on other sites
[quote]
<?php

echo "text1\n";
echo "text2\n";

?>
[/quote]

This code results in

[quote]
text1 text2
[/quote]

Is it supposed to?

Share this post


Link to post
Share on other sites
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]
<?php

echo "text1<br />";
echo "text2<br />";

?>
[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.