Quantcast
Channel: What does exactly mean by 'Line feeds' in HTML and PHP? How do they are added in HTML and PHP code? - Stack Overflow
Viewing all articles
Browse latest Browse all 3

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

$
0
0

I was reading PHP Manual and I come across following text paragraph :

Line feeds have little meaning in HTML, however it is still a good idea to make your HTML look nice and clean by putting line feeds in. A linefeed that follows immediately after a closing ?> will be removed by PHP. This can be extremely useful when you are putting in many blocks of PHP or include files containing PHP that aren't supposed to output anything. At the same time it can be a bit confusing. You can put a space after the closing ?> to force a space and a line feed to be output, or you can put an explicit line feed in the last echo/print from within your PHP block.

I've following questions related to the text from above paragraph :

  1. What does exactly mean by 'Line feeds' in HTML?
  2. How to add them to the HTML code as well as PHP code and make visible in a web browser? What HTML entities/tags/characters are used to achieve this?
  3. Is the meaning of 'Line feed' same in case of HTML and PHP? If no, what's the difference in meaning in both the contexts?
  4. Why the PHP manual is saying in first line of paragraph itself that? What does PHP Manual want to say by the below sentence?

"Line feeds have little meaning in HTML"

  1. How can it be useful to remove a linefeed that follows immediately after a closing tag ?> when someone is putting in many blocks of PHP or include files containing PHP that aren't supposed to output anything?

Please someone clear my above mentioned doubts by giving answer in simple, lucid and easy to understand language. If someone could accompany the answer by suitable working code examples it would be of great help to me in understanding the concept more clearly.

Thank You.


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles



Latest Images