new line in php
snippet in php

new line in php

user6862

<?php
echo "Hello world this is example \r\n in php.";
echo "<br>";
echo nl2br("You will find the \n newlines in this string \r\n on the browser window.");
?>

new line php

user9080

echo "<br>";

php line break

user4126



<?php

echo nl2br("One line.\nAnother line.");

?> 

php new line

user5593

echo "\n";
# it only works in double quotes

php new line

user9981

//let a variable contain multiple line
//add <br> tag in string
$variable = "123 <br> ";