Skip to content
Advertisement

PHP – Echo

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

echo "<br>Hello!";

Then the <br> string is not displayed, but a newline is displayed instead. How can I fix this? Thanks

Advertisement

Answer

Use entities”

echo "&lt;br>Hello!";

OR <xmp> tag in HTML:

echo '<xmp><br>hello</xmp>'
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement