[wd_asp elements=’search’ ratio=’100%’ id=1]

How to display HTML tags when saved in PHP variable

23rd January 2020

Php - Strings

php codehaven

If you have saved some HTML code that you have saved in a PHP variable and echo it, it will process the html and output this without the tags.
If you want to see the raw HTML use the method below.


$myvar = htmlspecialchars("

Codehaven is great!

", ENT_QUOTES);

echo $myvar;