php new line code example

Example 1: new line php

";
echo nl2br("You will find the \n newlines in this string \r\n on the browser window.");
?>
  // 2 Way
  

Example 2: newline in php

 can also be used.";
 echo "nl2br() is in-built function whereas 
is html tag"; ?>

Example 3: php new line

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

Example 4: php new line

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

Example 5: php new line

return nl2br("This is the cointracker sample text.\nThis should be line 2!");

Tags:

Misc Example