I am writing a blog and when I display code, I usually do so like this:
< pre > < code > Code Goes Here < / code > < / pre>
But it will not display the starting of php <?php
or the end ?>
and I really need it to. Any suggestions?
Thanks.
To display special characters in HTML, you must escape them.
< - <
> - >
& - &
" - "
' - '
So in your case, you want
<pre><code><?php (PHP CODE HERE) ?></code></pre>
(Also notice the order of closing tags must match the order of opening tags.