aaron at aaron-wright.com
04-Aug-2002 11:33
[editors note: str_pad() function could be a rather elegant
solution]
Not to sound picky or anything, but the first
example of the line-numbering is great, but this is the one change
that (in my opinion) makes it perfect:
$source[$i] =
"<code>[$i]".str_repeat("<span style=\"color:
#ffffff\">0</span>", 4 - strlen
($i))."</code>$source[$i]<br />";
That
combines the second comment of not setting the lines crooked and the
original idea into one. The zeros used as placeholders are matched to the
background-color (white, usually...) so you don't have to stare at them.