Here's what I get:
1 <pre>
2 <?php
3 $filename = 'syntax_h.php';
4 ob_start();
5 highlight_file($filename);
6 $source = ob_get_contents();
7 ob_end_clean();
8 $source = explode(chr(13), $source);
9 $temp = substr($source[0], 0, 35);
10 $temp .= substr($source[0], 36);
11 $source[0] = substr($temp, 6);
12 $temp = substr($source[count($source) - 1], 0, strlen($source[count($source) - 1]) - 8);
13 $source[count($source) - 1] = $temp;
14 for($i = 1; $i < count($source); $i++){
15 $source[$i] = substr($source[$i], 6);
16 }
17 for($i = 0; $i < count($source) - 1; $i++){
18 $source[$i] .= '<br />';
19 }
20 $spaces = strlen(count($source));
21 for($i = 0; $i < count($source); $i++){
22 $source[$i] = '<span style="color: #777777">' . ($i + 1) . '</span> ' . $source[$i];
23 for($j = 0; $j < $spaces - strlen($i + 1); $j++){
24 $source[$i] = ' ' . $source[$i];
25 }
26 }
27 for($i = 0; $i < count($source); $i++){
28 echo $source[$i];
29 }
30 ?>
31 </pre> I'm not sure why yours isn't getting the same thing. But your code also produced proper output so whatever works ^_^. Also, the idea behind using   instead of the space character is so that rather than using the
pre html tag the user can use a
span with another monospaced font. For instance, something like this: <span style="font-family: Courier New; font-size: 10pt"> which produces the same results.