\n
' or '\r\n
'You can use the PHP newline characters \n
or \r\n
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 \r\n you will find a newline in this string.";
echo "<br>";
echo nl2br("You will find the \n newlines in this string \r\n on the browser window.");
?>
i hope you like this small article.
Hi, My name is Harsukh Makwana. i have been work with many programming language like php, python, javascript, node, react, anguler, etc.. since last 5 year. if you have any issue or want me hire then contact me on [email protected]
How to find substring between the two words using jQuery
Use the JavaScript match() met...JavaScript vs jQuery Differences
When new developer starts learning in We...Laravel 8 Instamojo Payment Gateway Integration
Today we visually perceive How to integr...How to hide dropdown menu on click outside of the element in jQuery
Use the jQuery on() method You can us...Laravel 8 - Paypal Payment Gateway Integration
Laravel 8 PayPal Integration is the impo...