0

do you know why linefeeds "\n" not working in PHP?

15th Sep 2016, 5:01 PM
MD. WOALID HOSSAIN
MD. WOALID HOSSAIN - avatar
4 Réponses
+ 1
$sum = $x + $y; echo "$x + $y = $sum\n"; // subtract $diff = $x - $y; echo "$x - $y = $diff\n"; // multiply $product = $x * $y; echo "$x * $y = $product\n"; // divide and get quotient $quotient = $x / $y; echo "$x / $y = $quotient\n"; // divide and get modulus $modulus = $x % $y; echo "$x % $y = $modulus\n>";
16th Sep 2016, 4:44 PM
MD. WOALID HOSSAIN
MD. WOALID HOSSAIN - avatar
+ 1
Normally \n should be work in PHP but i think the IDE of sololearn website doesn't work. You can try offline on your coputer. For this website, you can use "<br>" to replace "\n".
31st Oct 2016, 10:12 AM
Việt Dũng Đặng Quang
Việt Dũng Đặng Quang - avatar
0
It does work but you have to use "\n" Can you give us the context yours not working ?
16th Sep 2016, 10:11 AM
Alasu Paul Sabrin
Alasu Paul Sabrin - avatar
0
you can use <br> instead of '\n'. <br> works fine
16th Jun 2017, 10:28 AM
MD. WOALID HOSSAIN
MD. WOALID HOSSAIN - avatar