我想使用Alex Gorbatchev SyntaxHighlighter插件在我的HTML页面中显示一些PHP。
我的问题是某些代码是由浏览器解释的,因为我不想这样做 (只是想以纯文本形式发送)
可以在那里找到代码 http://codepen.io/hugsbrugs/pen/OPEyZZ
我试图摆脱的错误是:
Failed to load resource: the server responded with a status of 404 (Not Found)
解
感谢@spender,我结束了:
<pre class="brush: php">
<?php
$code = file_get_contents('FILE_PATH');
echo htmlentities($code);
?>
</pre>
我希望我可以在PHP中使用HEREDOC而不是将我的代码存储在外部文件中,但考虑使用单引号和双引号,我无法实现它......