0

Hi ppl,

I am facing this weird problem with php newline character.

<?php
echo"Hello World!! \n Im new to php";
?>

can anyone pls point out what is wrong in the above code??
the output should be:
Hello World!!
Im new to php
but the output goes on the same line:
Hello World!! Im new to php

where am i going wrong pls point..

Thanks

2
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by lyrico
0

Try to use <br>

;
<?php

echo "Hello World!!"."<br>"."Im new to php";//sample 1

echo "Hello World!! <br> Im new to php";//sample 2
?>

Edited by lyrico: n/a

0

thanks a ton lyrico...u saved my day :)
have a nice day..

0

well im curious to know, why this happens? can anyone pls explain?? why cant we use "\n" in php. In fact i was using it like that until now, all of a sudden, it would not work for me today.

Thanks

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.