\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 harsukh21@gmail.com
How to Check If a Value Exists in an Array in JavaScript
Use the indexOf() Method You can use...How To Send email In NodeJs
Today, Laravelcode share with you how to...How to call a function repeatedly after fixed time interval in jQuery
Use the JavaScript setInterval() method...How to get substring from a string using jQuery
Use the JavaScript substring() ...How to Export 10M+ records in XLSX in Laravel 7.x using rap2hpoutre/fast-excel
This post introduce FastExcel for Larave...