I have the following code to format and print the output from highlight_file with line numbers:
Code:
if($_fileToHighlite)
   {
    print "<pre class=\"norm\">\n".$_showStr."</pre>\n";
    $_lines = highlight_file($_fileToHighlite, true); //, true
    $_lines = str_replace("<code>", "<code>\n", $_lines);
    $_lines = str_replace("\n\r", "\n", $_lines);
    $_lines = str_replace("\r", "", $_lines);
    $_lines = str_replace("&nbsp;", " ", $_lines);
    $_lines = str_replace("<br /></span>", "</span><br />", $_lines);
    $_linesRed = explode("\n", $_lines);
    $_lineNum = explode('<br />', $_linesRed[2]);
    $_display = $_linesRed[0].$_linesRed[1]."\n";
    for($_itr = 0; $_itr < count($_lineNum); $_itr++)
        {
         $_display .= "<span style=\"color:#000033\">".$_itr."</span>  ".$_lineNum[$_itr]."\n";
        }
    $_display .= str_replace("<br />", "\n", $_linesRed[3]).$_linesRed[4];
    print "\n<pre>\n".$_display."</pre>\n";
 }
In a view source window (from Firefox funning on MAC OSX)
Code:
<pre class="norm">
File: php/madeFiles.php</pre>

<pre>
<code><span style="color: #000000">
<span style="color:#000033">0</span>  <span style="color: #0000BB">&lt;?php
<span style="color:#000033">1</span>  $_added </span><span style="color: #007700">= array();</span>
<span style="color:#000033">2</span>  <span style="color: #0000BB">$_added</span><span style="color: #007700">[</span><span style="color: #DD0000">"madeFiles"</span><span style="color: #007700">] = </span><span style="color: #DD0000">"php/madeFiles.php"</span><span style="color: #007700">;</span>
<span style="color:#000033">3</span>  <span style="color: #0000BB">$_added</span><span style="color: #007700">[</span><span style="color: #DD0000">"lab_0.js"</span><span style="color: #007700">] = </span><span style="color: #DD0000">"js/lab_0.js"</span><span style="color: #007700">;</span>
<span style="color:#000033">4</span>  <span style="color: #0000BB">$_added</span><span style="color: #007700">[</span><span style="color: #DD0000">"lab_0.css"</span><span style="color: #007700">] = </span><span style="color: #DD0000">"css/lab_0.css"</span><span style="color: #007700">;</span>
<span style="color:#000033">5</span>  <span style="color: #FF8000">// addFile -&gt;</span>
<span style="color:#000033">6</span>  <span style="color: #0000BB">?&gt;</span>
</span></code></pre>
And, when copying from view source window and pasting into BBEdit text editor window (as initially when pasted into this post)
Code:
<pre class="norm">
File: php/madeFiles.php</pre>

<pre>
<code><span style="color: #000000">
<span style="color:#000033">0</span>  <span style="color: #0000BB">&lt;?php
<span style="color:#000033">1</span>  $_added </span><span style="color: #007700">= array();</span>

<span style="color:#000033">2</span>  <span style="color: #0000BB">$_added</span><span style="color: #007700">[</span><span style="color: #DD0000">"madeFiles"</span><span style="color: #007700">] = </span><span style="color: #DD0000">"php/madeFiles.php"</span><span style="color: #007700">;</span>
<span style="color:#000033">3</span>  <span style="color: #0000BB">$_added</span><span style="color: #007700">[</span><span style="color: #DD0000">"lab_0.js"</span><span style="color: #007700">] = </span><span style="color: #DD0000">"js/lab_0.js"</span><span style="color: #007700">;</span>

<span style="color:#000033">4</span>  <span style="color: #0000BB">$_added</span><span style="color: #007700">[</span><span style="color: #DD0000">"lab_0.css"</span><span style="color: #007700">] = </span><span style="color: #DD0000">"css/lab_0.css"</span><span style="color: #007700">;</span>
<span style="color:#000033">5</span>  <span style="color: #FF8000">// addFile -&gt;</span>
<span style="color:#000033">6</span>  <span style="color: #0000BB">?&gt;</span>

</span></code></pre>
So.. the question is what are the phantom line breaks?
As you can see in the code I am trying to eliminate both \n\r and \r

As a tangential concern, this project is experimental in that I am trying to develop a dependable and abstract
method of formatting strings from highlight_file with line numbers*. The problem is the position of <br /> tags
that would otherwise (other that the way I am doing it with span tags around the numbers) the line numbers
will wind up with the style rule of the last opening span tag.
* and in this case inside of pre tags so <br /> and &nbsp; can be replaced with \n and ' '(literal space)