在HTML中显示未解析的PHP

OPa*_*tel 2 html php parsing

我想在HTML中显示未解析的PHP代码.例如,我想在HTML文档中呈现它.

这是您在PHP中打印文本的方式

<?php print "Hello!"; ?>
Run Code Online (Sandbox Code Playgroud)

Ant*_*ony 12

通过将代码打印为字符串htmlspecialchars(),它们将不会被服务器或浏览器解析.

echo htmlspecialchars('<?php print "Hello!"; ?>')
Run Code Online (Sandbox Code Playgroud)