Answers for "how to add new line in echo command inphp"

PHP
2

append new line php

$data = 'some data'.PHP_EOL;
$fp = fopen('somefile', 'a');
fwrite($fp, $data);
Posted by: Guest on May-28-2020
2

newline in php

<?php
 echo nl2br("If you want that '\n' works. \n Then use nl2br() function!");
 echo "<br> can also be used.";
 echo "nl2br() is in-built function whereas <br> is html tag";
?>
Posted by: Guest on March-12-2021
1

php new line

return nl2br("This is the cointracker sample text.\nThis should be line 2!");
Posted by: Guest on February-22-2021

Browse Popular Code Answers by Language