I am using the \n to insert a new line when echoing a string in PHP. But the output does not seem to reflect this. I am using chrome browser to display the output.
Here is my code:
<?php
echo "Developers, Developers, developers, developers,\n developers,
developers, developers, developers, developers!";
?>
I expect the output to be:
Developers, Developers, developers, developers,
developers, developers, developers, developers, developers!
But it is being displayed in a single line in chrome as:
Developers, Developers, developers, developers, developers, developers, developers, developers, developers!
` as a new line in HTML output. (If you want to keep that `\n` in your string but have a new line in HTML, take a look at https://www.php.net/manual/en/function.nl2br.php) – brombeer May 08 '19 at 11:23
does work, but then what is the use of \n in PHP echo statements; also when using the <<< operator in multiline output statements the indentation are being ignored – Steve austin May 08 '19 at 11:25