Add new line in php command line or terminal

Adding a new line from php from HTML takes a break element such as </br>

Syntax : echo "Hello World <br> to all"

Output :

Hello World <br> to all

If we want to show the new line for command line <br> tag will not work ,it will render it as html showing it in plain form

If we want to add the new line to command line php ,We need to use "\n"

Syntax : echo "Hello World <\n> to all"

Output :

Hello World to all

Note: Please use only double quotes when using \n .

Syntax : echo 'Hello World <\n> to all' will not work Syntax : echo "Hello World <\n> to all" will work

php,temrinal,commandline