I want to show unparsed PHP code in my HTML. For example, I want this to render in my HTML documents.
This is how you print text in PHP
<?php print "Hello!"; ?>
I want to show unparsed PHP code in my HTML. For example, I want this to render in my HTML documents.
This is how you print text in PHP
<?php print "Hello!"; ?>
By printing the codes as a string with htmlspecialchars()
, they will not be parsed by either your server or the browser.
echo htmlspecialchars('<?php print "Hello!"; ?>')