Quantcast
Viewing all articles
Browse latest Browse all 3

Answer by Prosen for What does exactly mean by 'Line feeds' in HTML and PHP? How do they are added in HTML and PHP code?

'Lines feed' exactly means a 'New line' both in Html and Php, only the syntax is different.

  1. In case of Html tag, you can use <br> or <br/> tag for a Lines feed. Basically, this tag shows a new line in the output of the Html attribute block, while running through the browser.

  2. You can take the following example for <br> tag:

<html> <body>

<p> To break lines<br>in a text,<br/>use the br element. </p>

</body> </html>

Output:
To break lines
in a text,
use the br element.

  1. In case of Php, you can use '\n' for a lines feed.

  2. If you are using a string in Php, then instead of writing,

echo "New \nLine";

you can use nl2br() function to get line break, like:

echo nl2br("New \nLine");

Output:
New
Line


Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>