How to create a new line in PHP
In this post we will give you information about How to create a new line in PHP. Hear we will give you detail about How to create a new line in PHPAnd how to use it also give you demo for it if it is necessary.
Use the Newline Characters ‘n‘ or ‘rn‘
You can use the PHP newline characters n or rn to create a new line inside the source code. However, if you want the line breaks to be visible in the browser too, you can use the PHP nl2br() function which inserts HTML line breaks before all newlines in a string.
Let’s take a look at the following example to understand how it basically works:
<?php
echo "If you view the page source rn you will find a newline in this string.";
echo "<br>";
echo nl2br("You will find the n newlines in this string rn on the browser window.");
?>i hope you like this small article.
Hope this code and post will helped you for implement How to create a new line in PHP. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs
