Hello!"; Then the line is
not displayed, but a new line i...">

PHP - Echo <br>

I want my page to display <br>Hello!. But if I use

echo "<br>Hello!";

Then the line is <br>not displayed, but a new line is displayed instead. How can i fix this? Thanks

+4
source share
2 answers

Use Objects "

echo "&lt;br>Hello!";
Tag

OR <xmp>in HTML:

echo '<xmp><br>hello</xmp>'
+5
source

This is because you use HTML without replacing characters for text:

<?php
    echo "&lt;br&gt;Hello!";
?>
+4
source

All Articles