<?php
$code = "<?php echo \"hoi\"; ?>";
highlight_string($code); //laat <?php echo "hoi"; gehighlight zien.
$code = highlight_sting($code, true); //laat <?php echo "hoi"; highlighten en voert er ook nl2br() op uit
echo $code; //laat <?php echo "hoi"; gehighlight zien.
/*
uiteindelijk geeft dit de volgende output: (in php 5)
<code><span style="color: #000000">
<span style="color: #0000BB"><?php </span><span style="color: #007700">echo </span><span style="color: #DD0000">"hoi"</span><span style="color: #007700">; </span><span style="color: #0000BB">?></span>
</span>
</code><code><span style="color: #000000">
<span style="color: #0000BB"><?php </span><span style="color: #007700">echo </span><span style="color: #DD0000">"hoi"</span><span style="color: #007700">; </span><span style="color: #0000BB">?></span>
</span>
</code>
*/
?>
<?php
$code = "<?php echo \"hoi\"; ?>";
$code = highlight_sting($code, true); //laat <?php echo "hoi"; highlighten en voert er ook nl2br() op uit
echo $code; //laat <?php echo "hoi"; gehighlight zien. /*
uiteindelijk geeft dit de volgende output: (in php 5)
<code><span style="color: #000000">
<span style="color: #0000BB"><?php </span><span style="color: #007700">echo </span><span style="color: #DD0000">"hoi"</span><span style="color: #007700">; </span><span style="color: #0000BB">?></span>
</span>
</code><code><span style="color: #000000">
<span style="color: #0000BB"><?php </span><span style="color: #007700">echo </span><span style="color: #DD0000">"hoi"</span><span style="color: #007700">; </span><span style="color: #0000BB">?></span>
</span>
</code>
*/
?>