0
do you know why linefeeds "\n" not working in PHP?
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>";
+ 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".
0
It does work but you have to use "\n"
Can you give us the context yours not working ?
0
you can use <br> instead of '\n'. <br> works fine