Highlighting the array of code lines in PHP
<p>I have an associative array in which every single value contains one single line of code. I display them in the <code>foreach()</code> loop. How can I highlight all of them?</p>

<p>I've found the <code>highlight_string()</code> function. It does work, yes, but only with PHP tags surrounding the code. The problem is that I don't want to display these tags. It's an array, so the tags should be added to every single value which would make the outcome looks ugly.</p>

<p>Adding tags to the beginning and the end of the array doesn't work either - I won't use <code>highlight_string()</code> on the whole array (surrounging <code>foreach()</code> loop).</p>

<p>And if I get rid of the PHP tags, highlighting stops working.</p>

<p>Is there any way to do this without including 3rd party applications?</p>

<p>EXAMPLE:</p>

<p>This is the array:</p>

<pre><code>$var = array(0 =&gt; 'for($i=0;$i&lt;5;$i++)', 1 =&gt; '// do something', 2 =&gt; '$i++', 3 =&gt; '}');
</code></pre>

<p>This is how I display lines of code one after another:</p>

<pre><code>foreach($var as $line) 
{
   echo $line . '&lt;br&gt;';
}
</code></pre>

<p>And I want to display them as the highlighted code.</p>
