I get some html output as:
<div class="test-code">
<pre>
<code>
<?php echo "hello world"; ?>
</code>
</pre>
</div>
Is it possible to use any basic PHP syntax highlighter with above HTML without changing anything in above syntax? I have been searching, but most of the syntax highlighters seems to be pretty advanced and require to define the code class in the pre (eg. pre class="php").
Edit: I am looking for any Javascript/jQuery based syntax highlight which automatically assumes that any code inside the <code> is a PHP code and highlights it.
I would certainly recommend prettify.
It normally auto-detects the language being written in the code block.
Common usage is as follows:
NOTE: Prettify takes tabs literally. Do not tab your code within the block, but rather use spaces.