This problem is solely in having accurate HTML output.
In a simple PHP file, you can choose when PHP is embedded in the document using tags. However, it seems that when this tag is used directly above a regular HTML element, the new line separating the two appears to be deleted or ignored.
Observe the following code in PHP
<div> <?php echo "This is some extra text." ?> </div>
The output is as follows:
<div> This is some extra text.</div>
However, if I add something directly after the tag,
<div> <?php echo "This is some extra text." ?> Now the newline is honored. </div>
It seems that the new line is being followed:
<div> This is some extra text. Now the newline is honored. </div>
Again, this is a purely cosmetic problem and has nothing to do with incorrect page display. I want the source code to be pleasant and readable, and I could add the "\ n" character at the end of the first echo, but this does not seem satisfactory, and it will also be quite unpleasant. Is there any way to solve this problem, or am I just doing something wrong?
source share