1<?php
2echo "If you view the page source \r\n you will find a newline in this string.";
3echo "<br>";
4echo nl2br("You will find the \n newlines in this string \r\n on the browser window.");
5?>
6 // 2 Way
7 <?php echo $clientid, ' ', $lastname, PHP_EOL;?>
1<?php
2 echo nl2br("If you want that '\n' works. \n Then use nl2br() function!");
3 echo "<br> can also be used.";
4 echo "nl2br() is in-built function whereas <br> is html tag";
5?>
1if "test\n" not return, new line
2 1st solution:echo "test".PHP_EOL;
3 2nd solution:<?php header('Content-type: text/plain'); ?>
4 3rd solution:"<br />" instead of "\n" or "\r\n"