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?>
1<?php
2echo "Hello world this is example \r\n in php.";
3echo "<br>";
4echo nl2br("You will find the \n newlines in this string \r\n on the browser window.");
5?>